Skip to content

Commit

Permalink
Merge pull request #13582 from afedchin/hlsl-fix
Browse files Browse the repository at this point in the history
VideoPlayer: DirectX - make sure rgb values are not negative after yu…
  • Loading branch information
afedchin committed Feb 25, 2018
2 parents 6102388 + bfc35d9 commit cc13cc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/shaders/yuv2rgb_d3d.fx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit cc13cc8

Please sign in to comment.