diff options
author | Matthias Kortstiege <mkortstiege@users.noreply.github.com> | 2015-09-01 10:23:56 +0200 |
---|---|---|
committer | Matthias Kortstiege <mkortstiege@users.noreply.github.com> | 2015-09-01 10:23:56 +0200 |
commit | 777809dd12031d8b3c263710d69975d94306b003 (patch) | |
tree | 7d8155748d218bb5e8a83dbd469e0cf7e09ba1a3 /system | |
parent | ea1304187286a726a6de8f9c88f75f1413b653cc (diff) | |
parent | e7bc96cd219fd0f45f0d5c9b9b1888fdfcf433c4 (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.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_checkerboard_right.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_common.hlsl | 12 | ||||
-rw-r--r-- | system/shaders/guishader_default.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_fonts.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_interlaced_left.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_interlaced_right.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_multi_texture_blend.hlsl | 4 | ||||
-rw-r--r-- | system/shaders/guishader_texture.hlsl | 2 | ||||
-rw-r--r-- | system/shaders/guishader_vert.hlsl | 5 |
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; |