Skip to content

Commit e62ab58

Browse files
committed
[GPU] Use UNorm not signed EDRAM encoding in k_16_16 resolve packing.
The original commit (2eea146) 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.
1 parent 707052a commit e62ab58

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/xenia/gpu/shaders/pixel_formats.xesli

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ uint4_xe XePack32bpp4Pixels(float4_xe pixel_0, float4_xe pixel_1,
243243
break;
244244
case kXenosFormat_16_16_EDRAM:
245245
case kXenosFormat_16_16:
246-
packed.x = XePackR16G16Edram(pixel_0.rg);
247-
packed.y = XePackR16G16Edram(pixel_1.rg);
248-
packed.z = XePackR16G16Edram(pixel_2.rg);
249-
packed.w = XePackR16G16Edram(pixel_3.rg);
246+
packed.x = XePackR16G16UNorm(pixel_0.rg);
247+
packed.y = XePackR16G16UNorm(pixel_1.rg);
248+
packed.z = XePackR16G16UNorm(pixel_2.rg);
249+
packed.w = XePackR16G16UNorm(pixel_3.rg);
250250
break;
251251
case kXenosFormat_16_16_FLOAT:
252252
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,
272272
switch (format) {
273273
case kXenosFormat_16_16_16_16_EDRAM:
274274
case kXenosFormat_16_16_16_16:
275-
packed_01.xy = XePackR16G16B16A16Edram(pixel_0);
276-
packed_01.zw = XePackR16G16B16A16Edram(pixel_1);
277-
packed_23.xy = XePackR16G16B16A16Edram(pixel_2);
278-
packed_23.zw = XePackR16G16B16A16Edram(pixel_3);
275+
packed_01.xy = XePackR16G16B16A16UNorm(pixel_0);
276+
packed_01.zw = XePackR16G16B16A16UNorm(pixel_1);
277+
packed_23.xy = XePackR16G16B16A16UNorm(pixel_2);
278+
packed_23.zw = XePackR16G16B16A16UNorm(pixel_3);
279279
break;
280280
case kXenosFormat_16_16_16_16_FLOAT:
281281
packed_01.x = pack_half_2x16_xe(float2_xe(pixel_0.r, pixel_0.g));

0 commit comments

Comments
 (0)