Repository navigation
fix(agc): sample min and max S#s with a linear mip filter - #24097
Conversation
gfx1036 reduces the texels of both mip levels together when a min or max S# has a linear mip filter, and AMD's Vulkan driver matches it, so the decoder no longer throws for that combination. Such a sampler now needs the view format's min/max filter feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The changed code supports min/max reduction with linear mip filtering, and the submitted tests cover sampler decoding, format capability requirements, and image sampling behavior at the pinned head.
What I ran
Reviewed head f7812228ff706ce6275f66e58748ca39ab5797ea. I read the prepared description, commit summary, manifest, diff, and all five changed files listed in the manifest. I inspected the sampler construction and validation paths and the new execution test logic. No commands or tests were run; reported test results below are author supplied.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code review | passed | All five manifest files read |
| Tests in this review | not run | Author reports Windows GPU runs |
| PS5 behavior | not run | No console run reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently run the Windows tests, inspect GPU output, or verify PS5 behavior. The prepared files.json was not available through the reader; the manifest lists five changed files and each is marked included, and I read those five files. No files were listed as excluded in the available artifacts.
To get this to a good state
Nothing is required.
|
Linux/RADV run of this PR's head ( The three AMD GPUs pass. llvmpipe fails the new linear-mip rows, including the Mesa 25.2.8 / LLVM 20.1.2 build that
On both llvmpipe builds the first failure is in the new block ( The device has min/max filtering, so the test passes the The Vega and RADV numbers add Linux driver data to your gfx1036 and AMD Windows rows: RADV gives the both-levels result on GCN5, RDNA2 and RDNA3 at LODs 0.25 and 0.375. These runs used only those LODs, not your 32-LOD sweep. |
lavapipe does not reduce a min or max sampler's two mip levels together, so a linear mip filter there still throws; other hosts sample it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, that llvmpipe failure is a real gap. 208a6ad keeps the refusal on lavapipe:
I have no lavapipe on this machine, so I checked the lavapipe branch by forcing the flag off and the test's lavapipe condition on in a local build. Both GPUs then passed with the four refusals caught and the remaining rows (gathers, 8_8_8_8) still running after them. With the real code, on NVIDIA GeForce RTX 5080 (610.74) and AMD Radeon(TM) Graphics (gfx1036, 32.0.21045.16010), with |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The review folder and changed source files were not accessible through the available tools, so the change could not be verified.
What I ran
No reader commands ran. The pinned head and changed files were not inspected.
Results
| Check | Result | Note |
|---|---|---|
| Change review | not run | Source unavailable |
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The description, commits, diff, manifest, changed files, and repository context were not read. Files read: none. Files reviewed: none.
To get this to a good state
Nothing is required.
|
Rerun at
On llvmpipe the four linear-mip rows go through the |
|
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.
|
|
NVIDIA Blackwell run with the validation layer. Head Setup: NVIDIA GeForce RTX 5090 (
On this device the four new linear-mip rows run (the lavapipe-only refusal is not taken), and they match the two-level min/max expectation. Every log shows AI-assisted: yes |
|
Tested on Intel Arc B390 (Mesa 26.2.7 ANV, Linux 7.2.10), PR head
AI-assisted: yes (Claude Code) |
What
An S# with
FILTER_MODE1 or 2 (min or max) andMIP_FILTER2 (linear) used to throw inDecodeSamplerResource, because the drivers seemed to disagree (lavapipe against NVIDIA, as the min/max commit put it). gfx1036 hardware now settles what the result should be, and AMD's Vulkan driver gives that result on every measured row.GuestSamplerResource.cpp: the refusal is removed, so the sampler keeps Vulkan's min or max reduction withVK_SAMPLER_MIPMAP_MODE_LINEAR.Sampler.cpp: such a sampler now also needsSAMPLED_IMAGE_FILTER_MINMAXon the view format, even with point texel filtering, because it reduces across two levels.min, bilinear, linear mip: thread 0 sampled 14.000000, expected 5.000000on llvmpipe with LLVM 20 and 21). SoSampler::Validatekeeps throwing for a linear-mip min/max S# when the device's driver isVK_DRIVER_ID_MESA_LLVMPIPE(Context::samplerFilterMinmaxAcrossMips), and the GPU test expects that refusal there.DescriptorBindingBuilder).Min/max S# reductionentry now records the linear-mip rule.Measurement:
tools/hw-oracleon gfx1036 (AMD Windows driver 32.0.21045.16010), compared withagc_oracle_runnerwith the refusal removed, on an NVIDIA GeForce RTX 5080 (610.74) and on the gfx1036 iGPU through Vulkan.image_sample_lwith a linear mip filter, at 32 LODs from -0.5 to 2.5, including fine steps near 0, 1 and 2.Mip selection and blending on NVIDIA: at LOD 0.75 level 0's weight is 0, so max reads only level 1.Tested
Windows 11 Pro 10.0.26200, MinGW Release build.
ctest --test-dir build -R '^agc_driver_image_sample_reduction$|^agc_driver_graphics$' -VwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, onmainand on this branch. The GPUs were an NVIDIA GeForce RTX 5080 (610.74) and an AMD Radeon(TM) Graphics iGPU (gfx1036, 32.0.21045.16010).mainNVIDIAmainAMDInsert instance layer "VK_LAYER_KHRONOS_validation"was not found but was requestedVUID-agc_driver_graphicsis a CPU test and opens no Vulkan instance, hence one layer insert for two tests.agc_driver_image_sample_reduction: new runs of min and max with bilinear and point texel filters and a linear mip filter, at LODs 0.25 and 0.375. The expected value is the min or max of both levels' footprints. Those LODs keep both of NVIDIA's mip weights non-zero, so its mip rule cannot change the result. The test printedimage sample reduction tests passedon both GPUs.agc_driver_graphics: the two refusal checks for linear-mip min/max (one also anisotropic) became checks that min and max with point and bilinear texel filters decode toVK_SAMPLER_MIPMAP_MODE_LINEAR, chain the reduction, and require min/max filtering.main'sGuestSamplerResource.cppandSampler.cpp, both tests fail on both GPUs withguest sampler descriptor combines a min or max reduction with a linear mip filter, which is not implemented.Other open PRs: #20944 adds a
DecodeSamplerResourcecheck that expects this refusal, so that check needs to follow whichever lands second.tools/pr_overlap.pyfinds no conflicting lines. Of the 8 PRs it could not compare (they conflict withmain), none changes the refusal or therequiresFilterMinmaxassignment.Not tested on a PS5.
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)🤖 Generated with Claude Code