Repository navigation
Conversation
s_getreg_b32 threw for every hardware register except MODE (1), with "only the MODE round and denormal fields are modeled", so a shader that reads the debug identity registers could not be prepared. Registers 23 (HW_ID1) and 24 (HW_ID2) are read-only, debug-only registers that the RDNA3 instruction set reference lists as having unpredictable contents, so a fixed answer is within the architecture. Both now answer zero for any field: the host exposes no shader-engine, WGP or wave identity, so every wave reports engine 0, SIMD 0, wave 0 and VMID 0. A field that runs past the 32-bit register still throws, and every other register keeps throwing. The Last of Us Part II Remastered (PPSA15508) registers compute shader 0x129fc05a00, which reads s_getreg_b32 s58, 0x0c97 (HW_ID1 bits 18..19); the captured request now prepares (3476 SPIR-V words) where main stops at that error.
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
What
s_getreg_b32threw for every hardware register except MODE (1) with "only the MODE round and denormal fields are modeled", so a shader that reads the debug identity registers could not be prepared.Registers 23 (
HW_ID1) and 24 (HW_ID2) are read-only, debug-only registers that the RDNA3 instruction set reference lists as having unpredictable contents, so a fixed answer is within the architecture. Both now answer zero for any field: the host exposes no shader-engine, WGP or wave identity, so every wave reports engine 0, SIMD 0, wave 0 and VMID 0. A field that runs past the 32-bit register still throws, and every other read-only register (STATUS,TRAPSTS,HW_ID,GPR_ALLOC,LDS_ALLOC,IB_STS,TBA,TMA,FLAT_SCR,XNACK_MASK) keeps throwing.New cases in
ShaderModeRegisters: registers 23 and 24 answer a two-bit field at bit 18 and a whole-register read with zero, a field that runs past the register is refused, and register 4 is still refused.Tested
Linux x86-64 (CachyOS), GCC 16.2.1, Release.
agc_shader_mode_registerpasses with the change and fails without it: onmainthe new case stops ondebugIdentityRegisters: s_getreg_b32 at pc 0 reads hardware register 23 bits 18..19: only the MODE round and denormal fields are modeled.agc_shader_replay --prepareon the captured request of The Last of Us Part II Remastered (PPSA15508) compute shader0x129fc05a00, which readss_getreg_b32 s58, 0x0c97(HW_ID1, bits 18..19), prepares 3476 SPIR-V words with the change and stops at that error onmain. The title itself has not been re-run, so nothing is claimed about what it draws.python3 tools/check_conventions.py --base origin/main: 0 errors.python3 tools/pr_overlap.py --branch fix/shader-sgetreg-topology-registers --jobs 32: no shared exports. It reports file-level sharing only, with pull requests that add their own entries to the samecheckstable inShaderModeRegisters.cppor that touchScalarInstructions.cppfor unrelated reasons; two of them conflict withmainand could not be compared.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit