Skip to content

xshader: support vcc_lo/vcc_hi as dynamic s_load heap offsets - #297

Closed
twixed-RU wants to merge 1 commit into
brcly:mainfrom
twixed-RU:fix/sload-vcc-soffset
Closed

twixed-RU wants to merge 1 commit into
brcly:mainfrom
twixed-RU:fix/sload-vcc-soffset

Conversation

@twixed-RU

Copy link
Copy Markdown

Summary

  • Track Opnd::VccLo (106) and Opnd::VccHi (107) in res_block's sg() scalar dataflow map so s_load_dwordx4/x8 with soff = 106/107 resolves Sym::HeapOffset / Sym::HeapSamplerOffset when the register allocator places
    shifted heap offsets in vcc_lo/vcc_hi.
  • Guard never-written user SGPR table checks with < 106 so vcc_lo/vcc_hi are never treated as initial root table pointers, and allow 0..=107 in wave_loops::scalar for Res::HeapLoad / Res::HeapBuffer.
  • Use self.touch(&sreg_opnd(offset as u8)) in emit_smem for Res::HeapLoad and Res::HeapSamplerLoad instead of self.regs.insert(value.clone()) so vcc_lo/vcc_hi (already declared in the shader header) are not
    redeclared.
  • Add pixel_heap_allows_vcc_offsets unit test (fails without the fix, passes with it).

Testing

  • Environment: Linux (x86_64), NVIDIA GeForce RTX 3090, driver 580.196.07, backend proton (GE-Proton11-14)
  • python tuxbox.py check --no-gpu:
    • Build the shader compiler: passed
    • Python tests: passed
    • Shader compiler tests: passed (418 passed, including pixel_heap_allows_vcc_offsets)
    • DXBC tests: passed (70 passed)
    • XG layout tests: passed (14 passed)
    • D3D12 Windows typecheck: passed
  • python tuxbox.py check: 82/83 checks passed.
    • Known main failure: lanes-mesh-samplers (texel 0,0 is 1: point-filtered by the root's s0, not the program's literal linear state), verified to fail identically on main with Proton - Experimental and GE-Proton11-14.
  • AMD GPU run: still needed (tested on NVIDIA only).

@twixed-RU twixed-RU closed this Nov 27, 2026
@twixed-RU
twixed-RU deleted the fix/sload-vcc-soffset branch November 27, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant