From 167161d8ced84f8d1c779e91da2b85f6b7c85c15 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Fri, 3 Jun 2022 02:07:24 +0300 Subject: [PATCH] rsx: Restore some accidentally removed depth-format conversion macros --- rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl index 34ffb368ae..9e0b41d57c 100644 --- a/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl +++ b/rpcs3/Emu/RSX/Program/GLSLSnippets/ShuffleBytes.glsl @@ -12,8 +12,13 @@ layout(%set, binding=%loc, std430) buffer ssbo{ uint data[]; }; #define bswap_u16_u32(bits) (bits & 0xFFFF) << 16 | (bits & 0xFFFF0000) >> 16 // Depth format conversions -#define d24f_to_f32(bits) (bits << 7) -#define f32_to_d24f(bits) (bits >> 7) +#define d24_to_f32(bits) floatBitsToUint(float(bits) / 16777215.f) +#define f32_to_d24(bits) uint(uintBitsToFloat(bits) * 16777215.f) +#define d24f_to_f32(bits) (bits << 7) +#define f32_to_d24f(bits) (bits >> 7) +#define d24x8_to_f32(bits) d24_to_f32(bits >> 8) +#define d24x8_to_d24x8_swapped(bits) (bits & 0xFF00) | (bits & 0xFF0000) >> 16 | (bits & 0xFF) << 16 +#define f32_to_d24x8_swapped(bits) d24x8_to_d24x8_swapped(f32_to_d24(bits)) uint linear_invocation_id() {