From d5681ba01cf281a50a3540f6ce47f62c59504e49 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 6 May 2016 19:55:12 +0200 Subject: [PATCH] glsl: fix a bug in urban chaos hle shader Bug only impact the lsb bits of the depth conversion, so impact is likely small --- plugins/GSdx/res/glsl/tfx_fs.glsl | 2 +- plugins/GSdx/res/glsl_source.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/res/glsl/tfx_fs.glsl b/plugins/GSdx/res/glsl/tfx_fs.glsl index b3d211a2d1..726b0052a5 100644 --- a/plugins/GSdx/res/glsl/tfx_fs.glsl +++ b/plugins/GSdx/res/glsl/tfx_fs.glsl @@ -246,7 +246,7 @@ vec4 sample_depth(vec2 st) int depth = fetch_raw_depth(); // Convert lsb based on the palette - t = texelFetch(PaletteSampler, ivec2((depth & 0xFF), 0), 0); + t = texelFetch(PaletteSampler, ivec2((depth & 0xFF), 0), 0) * 255.0f; // Msb is easier float green = float((depth >> 8) & 0xFF) * 36.0f; diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index 24737cc4b4..b2261f1ccb 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -1090,7 +1090,7 @@ static const char* const tfx_fs_all_glsl = " int depth = fetch_raw_depth();\n" "\n" " // Convert lsb based on the palette\n" - " t = texelFetch(PaletteSampler, ivec2((depth & 0xFF), 0), 0);\n" + " t = texelFetch(PaletteSampler, ivec2((depth & 0xFF), 0), 0) * 255.0f;\n" "\n" " // Msb is easier\n" " float green = float((depth >> 8) & 0xFF) * 36.0f;\n"