Shaders: s_ttracedata_imm is SOPP opcode 0x28, not 0x26 #276
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!276
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/276/head"
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?
@Dufftwt on GitHub · 2026-11-24 01:59 UTC · original
Dufftwt:fix/s-ttracedata-imm-opcode→main· +19 −1 · 1 files · 1 commits · merged 2026-11-24 07:59 UTCWhat's wrong
The SOPP opcode table in
gfx10/opcodes.rshass_ttracedata_immat opcode0x26. RDNA2 encodes it at0x28:S_TTRACEDATA_IMMas SOPP opcode 40 (0x28).S_TTRACEDATA_IMM : SOPP_Real_32_gfx10_gfx13<0x028>, and its disassembler tests (gfx10_sopp.txt) decode0x34,0x12,0xa8,0xbfass_ttracedata_imm 0x1234.aco_opcodes.py, which has0x26. That's where the wrong number came from.s_ttracedata_immis a thread-trace marker, andir.rsalready lists it inDROPPEDas having no effect. But the real encoding (0xBFA8xxxx) decodes with no name, soir::buildrefuses the whole shader with "unknown opcode":What the fix does
The table entry moves from
0x026to0x028. The table stays sorted, and nothing else changes.How it behaves after the fix
A shader with a thread-trace marker decodes it as
s_ttracedata_imm. The IR drops it as intended, and the shader translates. Nothing else encodes0x26, so nothing that decoded before decodes differently now.Tests
The new test
s_ttracedata_imm_is_sopp_0x28(inopcodes.rs) decodes0xBFA81234and checks two things: the name iss_ttracedata_imm, andir::buildaccepts a program containing it.I ran
cargo test --workspaceon GitHub'swindows-latestwith Rust 1.98.1 fromrust-toolchain.toml:victory-shaderhas 70 passed, the other crates have 0 failed.main: it fails at the decode:left: None(no name for0xBFA81234),right: Some("s_ttracedata_imm").--test-threads=1. With 4 threads, the shader crate's GPU tests sometimes crash on that runner (#181, #244).Not tested: a title shader that carries the marker.
@jeremygold02 on GitHub · 2026-11-24 04:11 UTC · original · edited 2026-11-24 04:14 UTC
Tested PR #276 at head
79fb722a530056ce1f193b2a4476901de414a8d7(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at79fb722a530056ce1f193b2a4476901de414a8d7.cargo test --locked -p victory-shader s_ttracedata_imm_is_sopp_0x28— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 69 filtered out; finished in 0.00s ); cases: gfx10::opcodes::tests::s_ttracedata_imm_is_sopp_0x28.Behavior covered: Checks the GFX10 opcode table decodes s_ttracedata_imm as SOPP opcode 0x28.
Code: crates/victory-shader/src/gfx10/opcodes.rs