aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAnton Fedchin <afedchin@ruswizards.com>2015-12-28 15:46:13 +0300
committerAnton Fedchin <afedchin@ruswizards.com>2015-12-30 22:40:15 +0300
commit5199354a6306fde667e0e19667554d5653f850e0 (patch)
treeeb65fff2216dac9b097aae425ee0670ffdbf6855 /system
parente4784d699ef45804b93949327c7d90b37bd26380 (diff)
[VideoPlayer/VideoRenderers/Win] Added workaround to fix an issue with color range on some hardware which doesn't support color range conversion or whose drivers are crappy. Now we're using same technique for color range conversion which is used in UI instead of using video processor.
Diffstat (limited to 'system')
-rw-r--r--system/shaders/convolution-4x4_d3d.fx3
-rw-r--r--system/shaders/convolution-6x6_d3d.fx3
-rw-r--r--system/shaders/convolutionsep-4x4_d3d.fx3
-rw-r--r--system/shaders/convolutionsep-6x6_d3d.fx3
-rw-r--r--system/shaders/guishader_video.hlsl6
-rw-r--r--system/shaders/guishader_video_control.hlsl6
6 files changed, 12 insertions, 12 deletions
diff --git a/system/shaders/convolution-4x4_d3d.fx b/system/shaders/convolution-4x4_d3d.fx
index 9d92b12b22..f7d87b7e47 100644
--- a/system/shaders/convolution-4x4_d3d.fx
+++ b/system/shaders/convolution-4x4_d3d.fx
@@ -22,6 +22,7 @@ texture2D g_Texture;
texture2D g_KernelTexture;
float2 g_StepXY;
float2 g_viewPort;
+float2 g_colorRange;
SamplerState RGBSampler : IMMUTABLE
{
@@ -111,7 +112,7 @@ float4 CONVOLUTION4x4(float2 TextureUV : TEXCOORD0) : SV_TARGET
getLine(ypos.z, xpos, linetaps) * columntaps.b +
getLine(ypos.w, xpos, linetaps) * columntaps.a;
- return float4(rgb, 1.0);
+ return float4(g_colorRange.x + g_colorRange.y * saturate(rgb), 1.0);
}
technique11 SCALER_T
diff --git a/system/shaders/convolution-6x6_d3d.fx b/system/shaders/convolution-6x6_d3d.fx
index d6f1210ba2..d2f583a2c5 100644
--- a/system/shaders/convolution-6x6_d3d.fx
+++ b/system/shaders/convolution-6x6_d3d.fx
@@ -22,6 +22,7 @@ texture2D g_Texture;
texture2D g_KernelTexture;
float2 g_StepXY;
float2 g_viewPort;
+float2 g_colorRange;
SamplerState RGBSampler : IMMUTABLE
{
@@ -113,7 +114,7 @@ float4 CONVOLUTION6x6(in float2 TextureUV : TEXCOORD0) : SV_TARGET
getLine(ypos2.y, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b +
getLine(ypos2.z, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b;
- return float4(rgb, 1.0f);
+ return float4(g_colorRange.x + g_colorRange.y * saturate(rgb), 1.0);
}
technique11 SCALER_T
diff --git a/system/shaders/convolutionsep-4x4_d3d.fx b/system/shaders/convolutionsep-4x4_d3d.fx
index a778987651..40c14b632f 100644
--- a/system/shaders/convolutionsep-4x4_d3d.fx
+++ b/system/shaders/convolutionsep-4x4_d3d.fx
@@ -22,6 +22,7 @@ texture2D g_Texture;
texture2D g_KernelTexture;
float4 g_StepXY;
float2 g_viewPort;
+float2 g_colorRange;
SamplerState RGBSampler : IMMUTABLE
{
@@ -126,7 +127,7 @@ float4 CONVOLUTION4x4Vert(in float2 TextureUV : TEXCOORD0) : SV_TARGET
float xystart = (-1.0 - f.y) * g_StepXY.w + TextureUV.y;
float4 ypos = xystart + g_StepXY.w * float4(0.0, 1.0, 2.0, 3.0);
- return float4(getRow(TextureUV.x, ypos, columntaps), 1.0f);
+ return float4(g_colorRange.x + g_colorRange.y * saturate(getRow(TextureUV.x, ypos, columntaps)), 1.0);
}
technique11 SCALER_T
diff --git a/system/shaders/convolutionsep-6x6_d3d.fx b/system/shaders/convolutionsep-6x6_d3d.fx
index bf31f31fc1..376963571f 100644
--- a/system/shaders/convolutionsep-6x6_d3d.fx
+++ b/system/shaders/convolutionsep-6x6_d3d.fx
@@ -22,6 +22,7 @@ texture2D g_Texture;
texture2D g_KernelTexture;
float4 g_StepXY;
float2 g_viewPort;
+float2 g_colorRange;
SamplerState RGBSampler : IMMUTABLE
{
@@ -139,7 +140,7 @@ float4 CONVOLUTION6x6Vert(in float2 TextureUV : TEXCOORD0) : SV_TARGET
float3 ypos1 = ystart + g_StepXY.w * float3(0.0, 1.0, 2.0);
float3 ypos2 = ystart + g_StepXY.w * float3(3.0, 4.0, 5.0);
- return float4(getRow(TextureUV.x, ypos1, ypos2, columntaps1, columntaps2), 1.0);
+ return float4(g_colorRange.x + g_colorRange.y * saturate(getRow(TextureUV.x, ypos1, ypos2, columntaps1, columntaps2)), 1.0);
}
technique11 SCALER_T
diff --git a/system/shaders/guishader_video.hlsl b/system/shaders/guishader_video.hlsl
index 938c81f724..6b620ee68c 100644
--- a/system/shaders/guishader_video.hlsl
+++ b/system/shaders/guishader_video.hlsl
@@ -32,7 +32,5 @@ SamplerState DynamicSampler : register(s1)
float4 PS(PS_INPUT input) : SV_TARGET
{
- return texVideo.Sample(DynamicSampler, input.tex);
-}
-
-
+ return adjustColorRange(texVideo.Sample(DynamicSampler, input.tex));
+} \ No newline at end of file
diff --git a/system/shaders/guishader_video_control.hlsl b/system/shaders/guishader_video_control.hlsl
index ab73268163..d5a0ba1cc0 100644
--- a/system/shaders/guishader_video_control.hlsl
+++ b/system/shaders/guishader_video_control.hlsl
@@ -40,7 +40,5 @@ float4 PS(PS_INPUT input) : SV_TARGET
current.a = input.color.a;
current.rgb += specular.rgb - 0.5;
- return current;
-}
-
-
+ return adjustColorRange(current);
+} \ No newline at end of file