diff options
author | Anton Fedchin <anightik@gmail.com> | 2018-02-08 10:50:59 +0300 |
---|---|---|
committer | Anton Fedchin <anightik@gmail.com> | 2018-02-08 10:50:59 +0300 |
commit | 4f9f33a0b4137eb6d057d042e6dccc2a5c272b41 (patch) | |
tree | fb34a83295eebf6c63ababbac7a7da98fa4b13f1 /system | |
parent | a4899c44b9e7585d72fbe3c81bb01d78d1977719 (diff) |
[windows] use CConvertMatrix instead of YUVMatrix for yuv2rgb shader
Diffstat (limited to 'system')
-rw-r--r-- | system/shaders/yuv2rgb_d3d.fx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/system/shaders/yuv2rgb_d3d.fx b/system/shaders/yuv2rgb_d3d.fx index 85f6001db1..dd75621f08 100644 --- a/system/shaders/yuv2rgb_d3d.fx +++ b/system/shaders/yuv2rgb_d3d.fx @@ -24,7 +24,9 @@ texture2D g_Texture[3]; float4x4 g_ColorMatrix; float2 g_StepXY; float2 g_viewPort; - +float4x4 g_primMat; +float g_gammaDstInv; +float g_gammaSrc; SamplerState YUVSampler : IMMUTABLE { @@ -125,7 +127,11 @@ float4 YUV2RGB(VS_OUTPUT In) : SV_TARGET float4 YUV = float4(outY, outUV, 1.0); #endif - return output4(mul(YUV, g_ColorMatrix), In.TextureY); + float4 rgb = mul(YUV, g_ColorMatrix); +#if defined(XBMC_COL_CONVERSION) + rgb.rgb = pow(mul(pow(rgb, g_gammaSrc), g_primMat), g_gammaDstInv).rgb; +#endif + return output4(rgb, In.TextureY); } technique11 YUV2RGB_T |