aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Fedchin <afedchin@users.noreply.github.com>2018-02-25 13:04:40 +0300
committerGitHub <noreply@github.com>2018-02-25 13:04:40 +0300
commitcc13cc8ccacf30ba5b31ed5474aa2edfcb992f93 (patch)
tree40ef4eca3299f35c12a141b5f1c395cf0b92f484
parent61023886e81edc0eb5e5edc9589d28912b8ddfef (diff)
parentbfc35d938b98c66e9f898d79ed04de6c096c1f15 (diff)
Merge pull request #13582 from afedchin/hlsl-fix
VideoPlayer: DirectX - make sure rgb values are not negative after yu…
-rw-r--r--system/shaders/yuv2rgb_d3d.fx4
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);
}