fix(recompiler): drop a sample-adjust S# dword 3 that sets only reserved bits #7290
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7290"
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 gjonn on 2026-10-17T21:34:35Z.
What
An
image_sample_*_a(sample-adjust) S# whose dword 3 is a runtime value was refused withGetSamplerResource dword 3 is not a valid runtime valuewhen every bit it can set lies in the reserved bits 12-29, unless the value was an OR at the top.canonicalizeSampleAdjustDword3already drops reserved-only terms from an OR one by one; it now drops the whole dword 3 the same way when the value itself (not only one OR operand) can only set reserved bits, for example a field shifted to bit 12 with nothing else.PPSA01317 hits this in a pixel shader that issues
image_sample_awith S# dword 3 = (constant from the resource table) OR (a 16-bit field of a wave ballot shifted to bit 12). Onmainthe recompiler throws on it; with this change the shader compiles and the title gets past it.A plain
image_sample(no_a) with the same ballot-derived dword 3 is still refused.Tested
Windows 11, MinGW-w64 GCC, NVIDIA GeForce RTX 5090 Laptop GPU (driver 616.92). Rebased on
mainate0fcdb52b.agc_shader_memory(verifyUnnormalizedSamplers): a program whose S# dword 3 iss_lshl_b32of a maskedv_cmp/ballot result, used byimage_sample_a, must compile; the same S# used byimage_samplemust still throwGetSamplerResource dword 3 is not a valid runtime value.ResourceTracker.cppreverted tomain(test kept): fails withGetSamplerResource dword 3 is not a valid runtime value; chain: ShiftLeftLogical32(BitwiseAnd32(CompositeExtractU32x4(Ballot(INotEqual32(Immediate, GetBuiltin(Immediate, Immediate))), Immediate), Immediate), Immediate)agc_constant_phi: passes.python tools/check_conventions.py --base origin/mainandpython tools/check_test_registration.pypass.mainrefuses compiles with this change and boot continues past it.Not tested: AMD, Intel, Linux, macOS.
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 github-actions[bot] on 2026-10-17T21:54:57Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cpp