mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Make sure both bitwise values are unsigned for ps_convert_float32_float24 depth.
This commit is contained in:
parent
51fcd7b886
commit
fdcb0efe0a
|
@ -240,7 +240,7 @@ float rgb5a1_to_depth16(float4 val)
|
|||
float ps_convert_float32_float24(PS_INPUT input) : SV_Depth
|
||||
{
|
||||
// Truncates depth value to 24bits
|
||||
uint d = uint(sample_c(input.t).r * exp2(32.0f)) & 0xFFFFFF;
|
||||
uint d = uint(sample_c(input.t).r * exp2(32.0f)) & 0xFFFFFFu;
|
||||
return float(d) * exp2(-32.0f);
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ float rgb5a1_to_depth16(vec4 unorm)
|
|||
void ps_convert_float32_float24()
|
||||
{
|
||||
// Truncates depth value to 24bits
|
||||
uint d = uint(sample_c().r * exp2(32.0f)) & 0xFFFFFF;
|
||||
uint d = uint(sample_c().r * exp2(32.0f)) & 0xFFFFFFu;
|
||||
gl_FragDepth = float(d) * exp2(-32.0f);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -218,7 +218,7 @@ float rgb5a1_to_depth16(vec4 unorm)
|
|||
void ps_convert_float32_float24()
|
||||
{
|
||||
// Truncates depth value to 24bits
|
||||
uint d = uint(sample_c(v_tex).r * exp2(32.0f)) & 0xFFFFFF;
|
||||
uint d = uint(sample_c(v_tex).r * exp2(32.0f)) & 0xFFFFFFu;
|
||||
gl_FragDepth = float(d) * exp2(-32.0f);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
/// Version number for GS and other shaders. Increment whenever any of the contents of the
|
||||
/// shaders change, to invalidate the cache.
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 51;
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 52;
|
||||
|
|
Loading…
Reference in New Issue