Commit Graph
1 Commits
Author SHA1 Message Date
Yunus Shaikh 2cbaa96390 fix(shader): print memory instructions' pc and offset in the IR dump
The APS5_DUMP_IR dump showed every scalar load's immediate offset as 0.
An SMEM load keeps its immediate in the instruction's memory metadata:
MemoryFlags indexes Resources().memoryInfo, whose offset holds the
immediate plus 4 per component, while the soffset argument is the
constant 0 when the instruction has none. Buffer, address and shared
memory instructions keep their offsets there too. ProgramToString
printed the arguments, the type and the use count, but not the flags or
the metadata, so a dump could not tell 0x54 from 0x6c.

ProgramToString now appends " [pc=0x... off=0x...]" to every
instruction that carries memory metadata, and " [pc=0x... mem=?]" when
its index is past memoryInfo, since dumps run before validation. The
opcode set is one predicate, carriesMemoryInfo, which ValidateProgram
now also uses for its memory-info index check; the validator accepts and
rejects the same programs with the same messages.

https://github.com/boykopovar/AnyPS5/pull/9633#issuecomment-6349729587
Related: #9749.
2026-10-22 19:55:54 +00:00