From 806a33d62545f7447e2c662f6fce7e58d0b07c3d Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Thu, 20 May 2021 22:21:41 +0200 Subject: [PATCH] [GPU] Use `le<>` type for depth sample counts --- src/xenia/gpu/command_processor.cc | 1 + src/xenia/gpu/xenos.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/xenia/gpu/command_processor.cc b/src/xenia/gpu/command_processor.cc index d0ac7757e..77c25e0be 100644 --- a/src/xenia/gpu/command_processor.cc +++ b/src/xenia/gpu/command_processor.cc @@ -1145,6 +1145,7 @@ bool CommandProcessor::ExecutePacketType3_EVENT_WRITE_EXT(RingBuffer* reader, bool CommandProcessor::ExecutePacketType3_EVENT_WRITE_ZPD(RingBuffer* reader, uint32_t packet, uint32_t count) { + // Set by D3D as BE but struct ABI is LE const uint32_t kQueryFinished = xe::byte_swap(0xFFFFFEED); assert_true(count == 1); uint32_t initiator = reader->ReadAndSwap(); diff --git a/src/xenia/gpu/xenos.h b/src/xenia/gpu/xenos.h index 5b449958f..00c9c4f8a 100644 --- a/src/xenia/gpu/xenos.h +++ b/src/xenia/gpu/xenos.h @@ -1229,14 +1229,14 @@ struct alignas(uint32_t) xe_gpu_depth_sample_counts { // This is little endian as it is swapped in D3D code. // Corresponding A and B values are summed up by D3D. // Occlusion there is calculated by substracting begin from end struct. - uint32_t Total_A; - uint32_t Total_B; - uint32_t ZFail_A; - uint32_t ZFail_B; - uint32_t ZPass_A; - uint32_t ZPass_B; - uint32_t StencilFail_A; - uint32_t StencilFail_B; + le Total_A; + le Total_B; + le ZFail_A; + le ZFail_B; + le ZPass_A; + le ZPass_B; + le StencilFail_A; + le StencilFail_B; }; static_assert_size(xe_gpu_depth_sample_counts, sizeof(uint32_t) * 8);