From 16d2cc05c5dde6fac4ee3ed11c78cdcc93c75210 Mon Sep 17 00:00:00 2001 From: "Herman S." <429230+has207@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:11:22 +0900 Subject: [PATCH] [GPU] Use UNorm not signed EDRAM encoding in k_16_16 resolve packing. The original commit (2eea146b) correctly added kXenosFormat_16_16_EDRAM case labels and fixed the unpack clamp from -1.0 to -32.0, but incorrectly changed the resolve pack functions from UNorm to signed EDRAM encoding. The resolve destination is a regular texture sampled as UNorm [0,1], not EDRAM. Using EDRAM packing double-encodes the [-32,32] scaling, crushing all values by ~64x and caused visual issues particularly in UE3 titles. The bytecode submitted with the change was actually correct, but the source had additional incorrect pieces that only manifested when shaders were rebuilt. --- src/xenia/gpu/shaders/pixel_formats.xesli | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/xenia/gpu/shaders/pixel_formats.xesli b/src/xenia/gpu/shaders/pixel_formats.xesli index 691e2c5c1..3f6350848 100644 --- a/src/xenia/gpu/shaders/pixel_formats.xesli +++ b/src/xenia/gpu/shaders/pixel_formats.xesli @@ -243,10 +243,10 @@ uint4_xe XePack32bpp4Pixels(float4_xe pixel_0, float4_xe pixel_1, break; case kXenosFormat_16_16_EDRAM: case kXenosFormat_16_16: - packed.x = XePackR16G16Edram(pixel_0.rg); - packed.y = XePackR16G16Edram(pixel_1.rg); - packed.z = XePackR16G16Edram(pixel_2.rg); - packed.w = XePackR16G16Edram(pixel_3.rg); + packed.x = XePackR16G16UNorm(pixel_0.rg); + packed.y = XePackR16G16UNorm(pixel_1.rg); + packed.z = XePackR16G16UNorm(pixel_2.rg); + packed.w = XePackR16G16UNorm(pixel_3.rg); break; case kXenosFormat_16_16_FLOAT: packed.x = pack_half_2x16_xe(float2_xe(pixel_0.r, pixel_0.g)); @@ -272,10 +272,10 @@ void XePack64bpp4Pixels(float4_xe pixel_0, float4_xe pixel_1, switch (format) { case kXenosFormat_16_16_16_16_EDRAM: case kXenosFormat_16_16_16_16: - packed_01.xy = XePackR16G16B16A16Edram(pixel_0); - packed_01.zw = XePackR16G16B16A16Edram(pixel_1); - packed_23.xy = XePackR16G16B16A16Edram(pixel_2); - packed_23.zw = XePackR16G16B16A16Edram(pixel_3); + packed_01.xy = XePackR16G16B16A16UNorm(pixel_0); + packed_01.zw = XePackR16G16B16A16UNorm(pixel_1); + packed_23.xy = XePackR16G16B16A16UNorm(pixel_2); + packed_23.zw = XePackR16G16B16A16UNorm(pixel_3); break; case kXenosFormat_16_16_16_16_FLOAT: packed_01.x = pack_half_2x16_xe(float2_xe(pixel_0.r, pixel_0.g));