aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorMatthias Kortstiege <mkortstiege@users.noreply.github.com>2015-09-01 10:23:56 +0200
committerMatthias Kortstiege <mkortstiege@users.noreply.github.com>2015-09-01 10:23:56 +0200
commit777809dd12031d8b3c263710d69975d94306b003 (patch)
tree7d8155748d218bb5e8a83dbd469e0cf7e09ba1a3 /system
parentea1304187286a726a6de8f9c88f75f1413b653cc (diff)
parente7bc96cd219fd0f45f0d5c9b9b1888fdfcf433c4 (diff)
Merge pull request #7865 from afedchin/fix_range_dx
[dx11] Fixed displaying GUI in limited color range.
Diffstat (limited to 'system')
-rw-r--r--system/shaders/guishader_checkerboard_left.hlsl2
-rw-r--r--system/shaders/guishader_checkerboard_right.hlsl2
-rw-r--r--system/shaders/guishader_common.hlsl12
-rw-r--r--system/shaders/guishader_default.hlsl2
-rw-r--r--system/shaders/guishader_fonts.hlsl2
-rw-r--r--system/shaders/guishader_interlaced_left.hlsl2
-rw-r--r--system/shaders/guishader_interlaced_right.hlsl2
-rw-r--r--system/shaders/guishader_multi_texture_blend.hlsl4
-rw-r--r--system/shaders/guishader_texture.hlsl2
-rw-r--r--system/shaders/guishader_vert.hlsl5
10 files changed, 21 insertions, 14 deletions
diff --git a/system/shaders/guishader_checkerboard_left.hlsl b/system/shaders/guishader_checkerboard_left.hlsl
index 3795b7277c..7639a8cb5a 100644
--- a/system/shaders/guishader_checkerboard_left.hlsl
+++ b/system/shaders/guishader_checkerboard_left.hlsl
@@ -22,7 +22,7 @@
Texture2D texView : register(t0);
-cbuffer cbViewPort : register(b0)
+cbuffer cbViewPort : register(b1)
{
float g_viewPortX;
float g_viewPortY;
diff --git a/system/shaders/guishader_checkerboard_right.hlsl b/system/shaders/guishader_checkerboard_right.hlsl
index 2b0d96941e..eb02a21004 100644
--- a/system/shaders/guishader_checkerboard_right.hlsl
+++ b/system/shaders/guishader_checkerboard_right.hlsl
@@ -22,7 +22,7 @@
Texture2D texView : register(t0);
-cbuffer cbViewPort : register(b0)
+cbuffer cbViewPort : register(b1)
{
float g_viewPortX;
float g_viewPortY;
diff --git a/system/shaders/guishader_common.hlsl b/system/shaders/guishader_common.hlsl
index c912201364..0f2a7a7c47 100644
--- a/system/shaders/guishader_common.hlsl
+++ b/system/shaders/guishader_common.hlsl
@@ -42,6 +42,18 @@ SamplerState LinearSampler : register(s0)
Comparison = NEVER;
};
+cbuffer cbWorld : register(b0)
+{
+ float4x4 worldViewProj;
+ float blackLevel;
+ float colorRange;
+};
+
+inline float4 adjustColorRange(float4 color)
+{
+ return float4(blackLevel + colorRange * color.rgb, color.a);
+}
+
#define STEREO_LEFT_EYE_INDEX 0
#define STEREO_RIGHT_EYE_INDEX 1
diff --git a/system/shaders/guishader_default.hlsl b/system/shaders/guishader_default.hlsl
index bf68e44f18..cf4183a0f9 100644
--- a/system/shaders/guishader_default.hlsl
+++ b/system/shaders/guishader_default.hlsl
@@ -22,7 +22,7 @@
float4 PS(PS_INPUT input) : SV_TARGET
{
- return input.color;
+ return adjustColorRange(input.color);
}
diff --git a/system/shaders/guishader_fonts.hlsl b/system/shaders/guishader_fonts.hlsl
index c0acdb7788..def887d162 100644
--- a/system/shaders/guishader_fonts.hlsl
+++ b/system/shaders/guishader_fonts.hlsl
@@ -25,7 +25,7 @@ Texture2D texFont : register(t0);
float4 PS(PS_INPUT input) : SV_TARGET
{
input.color.a *= texFont.Sample(LinearSampler, input.tex).r;
- return input.color;
+ return adjustColorRange(input.color);
}
diff --git a/system/shaders/guishader_interlaced_left.hlsl b/system/shaders/guishader_interlaced_left.hlsl
index fcb6d272f0..41a7b928ab 100644
--- a/system/shaders/guishader_interlaced_left.hlsl
+++ b/system/shaders/guishader_interlaced_left.hlsl
@@ -22,7 +22,7 @@
Texture2D texView : register(t0);
-cbuffer cbViewPort : register(b0)
+cbuffer cbViewPort : register(b1)
{
float g_viewPortX;
float g_viewPortY;
diff --git a/system/shaders/guishader_interlaced_right.hlsl b/system/shaders/guishader_interlaced_right.hlsl
index ac3b8af067..394d5b9060 100644
--- a/system/shaders/guishader_interlaced_right.hlsl
+++ b/system/shaders/guishader_interlaced_right.hlsl
@@ -22,7 +22,7 @@
Texture2D texView : register(t0);
-cbuffer cbViewPort : register(b0)
+cbuffer cbViewPort : register(b1)
{
float g_viewPortX;
float g_viewPortY;
diff --git a/system/shaders/guishader_multi_texture_blend.hlsl b/system/shaders/guishader_multi_texture_blend.hlsl
index e968ae3ca6..33f1f0fbd3 100644
--- a/system/shaders/guishader_multi_texture_blend.hlsl
+++ b/system/shaders/guishader_multi_texture_blend.hlsl
@@ -24,8 +24,8 @@ Texture2D txDiffuse[2] : register(t0);
float4 PS(PS_INPUT input) : SV_TARGET
{
- return input.color * txDiffuse[0].Sample(LinearSampler, input.tex)
- * txDiffuse[1].Sample(LinearSampler, input.tex2);
+ return adjustColorRange(input.color * txDiffuse[0].Sample(LinearSampler, input.tex)
+ * txDiffuse[1].Sample(LinearSampler, input.tex2));
}
diff --git a/system/shaders/guishader_texture.hlsl b/system/shaders/guishader_texture.hlsl
index b557e3bf80..845747ec41 100644
--- a/system/shaders/guishader_texture.hlsl
+++ b/system/shaders/guishader_texture.hlsl
@@ -24,7 +24,7 @@ Texture2D texMain : register(t0);
float4 PS(PS_INPUT input) : SV_TARGET
{
- return input.color * texMain.Sample(LinearSampler, input.tex);
+ return adjustColorRange(input.color * texMain.Sample(LinearSampler, input.tex));
}
diff --git a/system/shaders/guishader_vert.hlsl b/system/shaders/guishader_vert.hlsl
index 17991993a4..508cbb7e1b 100644
--- a/system/shaders/guishader_vert.hlsl
+++ b/system/shaders/guishader_vert.hlsl
@@ -20,11 +20,6 @@
#include "guishader_common.hlsl"
-cbuffer cbWorld : register(b0)
-{
- float4x4 worldViewProj;
-};
-
PS_INPUT VS(VS_INPUT input)
{
PS_INPUT output = (PS_INPUT)0;