fix(shader): point-filter a filter mode 3 sampler as a weighted average #27452
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27452"
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 milescoviello on 2026-11-26T12:46:03Z.
What
#22665 samples S# filter mode 3 as a weighted average and lets image-table samplers with mode 3 into the table, but ReducesBetweenTexels still counted any nonzero filter mode as a min or max reduction. The point-filtered variant of such a sampler, built for a sint, converted or depth-bits image, then threw 'a min or max reduction sampler that filters between texels or mip levels samples an image that needs point filtering'. Only modes 1 and 2 reduce; mode 3 now point-filters like mode 0.
Tested
Ghost of Tsushima (PPSA02225), Linux, NVIDIA RTX 4070 Ti (driver 615.71.09), the same 600 s scripted run:
main341a9eec1, which has #22665: the title stops at 145 s withwhat(): compute shader 0x2000106500: DescriptorBindingBuilder: a min or max reduction sampler that filters between texels or mip levels samples an image that needs point filtering (sint, converted or depth-bits format), which is not implemented. The three rotation runs just before #22665 merged, onmain8a4371011,8deb9bf1dandf171065f7, ran the full 600 s with no such error.main9931d320d, the next rotation run: stops the same way at 94 s, in compute shader0x20001ac700.mainf0f208dc7, the run after that: stops the same way at 167 s, in compute shader0x2000106500.main9415030dfe3+ this change: ran the full 604 s with no such error, the loading screen at 150 s and 300 s, then the night beach combat in the game at 450 s and 600 s.Tests (
agc_graphics_profile_drawruns the sampler tests inGuestSamplerResource.cpp):6f423f550bfonmain9415030dfe3:agc_graphics_profile_draw,agc_driver_image_sample_reductionandagc_driver_image_filter_mode_three(#22665's test) pass in 3 of 3 runs.ReducesBetweenTexelscounting any nonzero filter mode again,agc_graphics_profile_drawfails in 3 of 3 runs.6f423f550bf:agc_graphics_profile_drawandagc_driver_image_sample_reductionpass in 3 of 3 runs. (agc_driver_image_filter_mode_threewas not yet in that build.)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)mainstops at 94 to 167 s; with this change the run reached the game, see Tested)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T12:56:37Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected change blocks merging; the code distinguishes min/max reductions from weighted-average mode 3 and adds a focused regression assertion.
What I ran
Reviewed head
6f423f550bf67282fa502b6dc5cad9613417230b. I read the prepared description, commit list, manifest, diff, and both changed files at the changed functions. No tests or builds were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all files listed under
reviewedin the manifest:core/libs/prx/libSceAgcDriver/tests/GuestSamplerResource.cppandcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp. The excluded-file list was not present in the supplied manifest. I did not independently verify the reported game runs, test runs, or mutation check.To get this to a good state
Nothing is required.