Commit f4f3394f authored by Steve Lhomme's avatar Steve Lhomme

direct3d11: support VLC_CODEC_I420_10L direct rendering

parent ff6c207c
......@@ -79,6 +79,7 @@ static const d3d_format_t d3d_formats[] = {
{ "NV11", DXGI_FORMAT_NV11, VLC_CODEC_I411, 8, 4, 1, { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM} },
#endif
{ "I420", DXGI_FORMAT_UNKNOWN, VLC_CODEC_I420, 8, 2, 2, { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM } },
{ "I420_10", DXGI_FORMAT_UNKNOWN, VLC_CODEC_I420_10L, 10, 2, 2, { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM } },
{ "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA, 8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
{ "VA_BGRA", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE, 8, 1, 1, { DXGI_FORMAT_B8G8R8A8_UNORM } },
{ "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA, 8, 1, 1, { DXGI_FORMAT_R8G8B8A8_UNORM } },
......
......@@ -1778,11 +1778,18 @@ static HRESULT CompilePixelShader(vout_display_t *vd, const d3d_format_t *format
"sample = shaderTexture[0].Sample(samplerState, coords);";
break;
case DXGI_FORMAT_UNKNOWN:
psz_sampler =
"sample.x = shaderTexture[0].Sample(samplerState, coords).x;\
sample.y = shaderTexture[1].Sample(samplerState, coords).x;\
sample.z = shaderTexture[2].Sample(samplerState, coords).x;\
sample.a = 1;";
if (format->fourcc == VLC_CODEC_I420_10L)
psz_sampler =
"sample.x = shaderTexture[0].Sample(samplerState, coords).x * 64;\
sample.y = shaderTexture[1].Sample(samplerState, coords).x * 64;\
sample.z = shaderTexture[2].Sample(samplerState, coords).x * 64;\
sample.a = 1;";
else
psz_sampler =
"sample.x = shaderTexture[0].Sample(samplerState, coords).x;\
sample.y = shaderTexture[1].Sample(samplerState, coords).x;\
sample.z = shaderTexture[2].Sample(samplerState, coords).x;\
sample.a = 1;";
break;
default:
vlc_assert_unreachable();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment