fix(shader): capture image descriptors read from constant buffers at uniform offsets #5188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5188"
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 EagleBearerYS on 2026-10-13T14:10:03Z.
What
Resident Evil Village (PPSA01556, content 01.210.000) stops preparing one of its mesh programs while it creates its PSO cache:
The program reads its T# with
s_buffer_load_dwordx8from 48-byte records, with the T# at +16. The record index comes through two more constant-buffer loads keyed by user data. Everything in the chain is uniform per draw, so the CPU walk can evaluate it.ResourceTracker::GetHandlerefused every T# whose dwords are scalar buffer loads (ReadConstBuffer) beforeValidateSourcelooked at them. Tables with a 32-byte stride and a wave-uniform key are planned as bindless tables beforeGetHandleruns, so only the other cases hit the refusal: a T# read at an offset the walk can evaluate.ValidateSource(SrtRuntimeValidator) already acceptsReadConstBufferwith uniform operands and refuses the rest. The pre-check is removed, and the walk reads the T# at each capture.Tested
maina252fcd75:agc_shader_memoryverifyUniformTableImage.s_buffer_load_dwordx8ats2 * 48 + 16.main'sResourceTracker.cppit fails with the title's message:GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000001c(...).s2 = 2ands2 = 1read the T#s of records 2 and 1.agc_shader_memory,agc_shader_bindless,agc_shader_srt_read_patching,agc_shader_frontend_pair,agc_shader_frontend_pair_offandagc_shader_disk_cachepass, also with the other two Resident Evil Village fixes (listed in #5169) merged in.maina252fcd75: the same six tests pass.mainit stops at the first frame, #4949): the mesh program prepares, and the PSO cache build continues past it.python3 tools/check_conventions.py --base origin/main: passed.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)Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T10:00:40Z.
Data point from another title. Marvel's Wolverine (PPSA03671, 01.001.005), Linux, RTX 3080 Ti (NVIDIA 615.71.09): on
main43349d433with a local patch that drops draws and dispatches whose shader fails, 36 shaders failed withGetImageResource dword 0 is not a valid runtime value(chain:ReadConstBuffer(GetBufferResource(ReadConst(GetSrtResource, ...)))). With this PR merged on top (together with #5620, #5550 and #5473), those 36 go to 0 in the same scene and shader cache fresh. The shaders then stop at the next limit instead:bindless storage image tables are unsupported(13) andstatic bindless image capacity exceeded(4). The picture does not change yet, because 105 other shaders fail onGetSamplerResource(a sampler read the same way). More in https://github.com/boykopovar/AnyPS5/discussions/5516.AI-assisted; the runs are from my machine.