fix(shader): make s_getpc_b64 return the shader's absolute address #111
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/111"
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?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-09-28T23:57:18Z.
What
s_getpc_b64returned the next instruction's offset from the start of the shader, not its address. A shader that addresses data stored after its own code builds a V# withs_getpc_b64; s_add_u32; s_addc_u32, so the V# pointed at a tiny address near zero.The result is now
GetShaderBase + offset.GetShaderBaseis already evaluated per request from the code address by the resource walk. So the V# names the real data, and the same code loaded at another address still shares its compiled variant.Found on Astro Bot's NV12→RGB video pass. It draws its quad with an NGG shader that fetches the four vertices from behind its own code (
+0x98). The buffer resolved to0xf0, every vertex read as zero, and the video stayed black.Tested
agc_shader_memory_tests: a vertex shader loads a dword stored behind its code through a PC-relative V#. It checks that the V# names that data at the shader's address, and that a copy at a second address binds its own data. It fails onmainwith "the V# does not name the data at the shader's address".ctest: 57/57 pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository