diff options
author | Anton Fedchin <afedchin@ruswizards.com> | 2018-02-25 12:43:09 +0300 |
---|---|---|
committer | Anton Fedchin <afedchin@ruswizards.com> | 2018-02-25 13:01:57 +0300 |
commit | bfc35d938b98c66e9f898d79ed04de6c096c1f15 (patch) | |
tree | 40ef4eca3299f35c12a141b5f1c395cf0b92f484 | |
parent | 61023886e81edc0eb5e5edc9589d28912b8ddfef (diff) |
VideoPlayer: DirectX - make sure rgb values are not negative after yuv2rgb conversion.
-rw-r--r-- | system/shaders/yuv2rgb_d3d.fx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/system/shaders/yuv2rgb_d3d.fx b/system/shaders/yuv2rgb_d3d.fx index 4eb59dd6f0..eef7f16f01 100644 --- a/system/shaders/yuv2rgb_d3d.fx +++ b/system/shaders/yuv2rgb_d3d.fx @@ -129,7 +129,9 @@ float4 YUV2RGB(VS_OUTPUT In) : SV_TARGET float4 rgb = mul(YUV, g_ColorMatrix); #if defined(XBMC_COL_CONVERSION) - rgb.rgb = pow(max(0.0, mul(pow(rgb, g_gammaSrc), g_primMat)), g_gammaDstInv).rgb; + rgb.rgb = pow(max(0.0, rgb.rgb), g_gammaSrc); + rgb.rgb = max(0.0, mul(rgb, g_primMat).rgb); + rgb.rgb = pow(rgb.rgb, g_gammaDstInv); #endif return output4(rgb, In.TextureY); } |