From bd0de8fbaf0c1bbb5924d8a96a023275df0cb7d8 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 7 Aug 2015 09:48:35 +0200 Subject: [PATCH] glsl: (colclip) HDR doesn't need wrapping neither clamping Might save a couple of instruction in the PS --- plugins/GSdx/res/glsl/tfx_fs.glsl | 4 ++-- plugins/GSdx/res/glsl_source.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/plugins/GSdx/res/glsl/tfx_fs.glsl index 6fba02473e..d794d2cf11 100644 --- a/plugins/GSdx/res/glsl/tfx_fs.glsl +++ b/plugins/GSdx/res/glsl/tfx_fs.glsl @@ -442,7 +442,7 @@ void ps_blend(inout vec4 Color, float As) // FIXME dithering // Correct the Color value based on the output format -#if PS_COLCLIP == 0 +#if PS_COLCLIP == 0 && PS_HDR == 0 // Standard Clamp Color.rgb = clamp(Color.rgb, vec3(0.0f), vec3(255.0f)); #endif @@ -457,7 +457,7 @@ void ps_blend(inout vec4 Color, float As) // In 16 bits format, only 5 bits of colors are used. It impacts shadows computation of Castlevania Color.rgb = vec3(ivec3(Color.rgb) & ivec3(0xF8)); -#elif PS_COLCLIP == 1 +#elif PS_COLCLIP == 1 && PS_HDR == 0 Color.rgb = vec3(ivec3(Color.rgb) & ivec3(0xFF)); #endif diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index f7a4d23153..0b0530a4a7 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -1301,7 +1301,7 @@ static const char* tfx_fs_all_glsl = " // FIXME dithering\n" "\n" " // Correct the Color value based on the output format\n" - "#if PS_COLCLIP == 0\n" + "#if PS_COLCLIP == 0 && PS_HDR == 0\n" " // Standard Clamp\n" " Color.rgb = clamp(Color.rgb, vec3(0.0f), vec3(255.0f));\n" "#endif\n" @@ -1316,7 +1316,7 @@ static const char* tfx_fs_all_glsl = " // In 16 bits format, only 5 bits of colors are used. It impacts shadows computation of Castlevania\n" "\n" " Color.rgb = vec3(ivec3(Color.rgb) & ivec3(0xF8));\n" - "#elif PS_COLCLIP == 1\n" + "#elif PS_COLCLIP == 1 && PS_HDR == 0\n" " Color.rgb = vec3(ivec3(Color.rgb) & ivec3(0xFF));\n" "#endif\n" "\n"