D3D12: AdvancePredicationX advance step size (info wanted) #10
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@omonkeyz on GitHub · 2026-11-21 16:53 UTC · original
D3D12 CommandList slot 86, AdvancePredicationX (
crates/compat/d3d12_xs/src/cl_fw.rs)The console emits firmware record 0x4000d100 (
IT1_ADVANCE_PREDICATION_X, one unused dword). It pairs with SetPredicationBufferX, record 0xd0{buffer_addr_lo, buffer_addr_hi, offset}. The firmware moves the predicate address forward on each advance, but by how much is unknown. The CP firmware isn't in any game dump, and the debug UMDs only validateBufferLocation % 8.The emulator currently uses predicate = buffer + offset and advance = +8 bytes. That is inferred, not confirmed.
If you have the console
d3d12_x.hdocumentation for AdvancePredicationX, a title that calls it, or the CP firmware handling of 0xd1, please share the step size, plus whetheroffsetis the start position or the stride.@QuentinDanblon on GitHub · 2026-11-21 18:12 UTC · original
No proof of the step size, but here are public data points that narrow it down:
PM4_PFP_SET_PREDICATIONinsrc/core/hw/gfxip/gfx9/chip/gfx9_plus_merged_f32_pfp_pm4_packets.handCmdUtil::BuildSetPredicationingfx9CmdUtil.cpp:pred_op(ord2 bits 18:16): 0 clear, 1 ZPASS, 2 PRIMCOUNT, 3 DX12 (Boolean64), 4 Vulkan (Boolean32).continuebit (ord2 bit 31) is only legal for ZPASS/PRIMCOUNT. It accumulates several query results into one predicate (radeonsisi_query.cemit_set_predicatesets it on every packet after the first, walkingresults_base += result_size).BufferLocation % 8check suggests, the firmware cannot use the hardware continue path. The next predicate is then the next aligned bool64, which is +8 and matches the current assumption. The alternatives would be +4 (bool32) or one ZPASS slot (16 B × number of RBs, plus 16 in radeonsi's layout) if the console predicates directly on occlusion query memory.index*8mean 8; dword stores atindex*4mean 4. Or check whether theoffsetvalues passed to SetPredicationBufferX are multiples of 16×RB.Links: https://github.com/GPUOpen-Drivers/pal (gfx9 PM4 headers), https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/drivers/radeonsi/si_query.c
@omonkeyz on GitHub · 2026-11-23 13:12 UTC · original
Thanks, this narrows it down. +8 (bool64) stays the assumption; the next check is the stride of the stores that fill the predication buffer in a title capture.