Repository navigation
Conversation
An S#'s XY_MAG_FILTER / XY_MIN_FILTER are 0 point, 1 bilinear, 2 aniso point, 3 aniso bilinear (Mesa's SQ_TEX_XY_FILTER), and a driver writes aniso point for a nearest filter when anisotropy is on (radv_tex_filter: NEAREST with max_aniso > 1). sampler_d3d12 took any value from 2 up as anisotropic and as linear, so a point sampler with the anisotropy bits set came out D3D12_FILTER_ANISOTROPIC (linear), or linear with a ratio of 1: lookup tables and G-buffer reads meant to be point-sampled were blended. The HLSL the recompiler emits for implicit-LOD samples copies the same rule. Now only aniso bilinear (3) is anisotropic, and linear means bilinear or aniso bilinear (bit 0): aniso point is point, in desc.rs and in emit.rs. decodes_ssharp used 2 for an anisotropic filter; it uses 3 now, and checks 2 as point. The GPU test of implicit-LOD sampling between mips runs once more with aniso point min / mag at a 4x ratio and must give the point filter's texels; it fails without the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Owner
Author
|
Upstream PR xcl-dev#1117 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An S#'s
XY_MAG_FILTER/XY_MIN_FILTERare 0 point, 1 bilinear, 2 aniso point, 3 aniso bilinear (Mesa'sSQ_TEX_XY_FILTERenum, e.g.src/amd/registers/gfx8.json). A driver writes aniso point for a nearest filter when anisotropy is on: Mesa'sradv_tex_filterreturnsmax_ansio > 1 ? V_008F38_SQ_TEX_XY_FILTER_ANISO_POINT : V_008F38_SQ_TEX_XY_FILTER_POINTforVK_FILTER_NEAREST.desc::sampler_d3d12took every value from 2 up as anisotropic and as linear. So a point sampler with the anisotropy bits set came out asD3D12_FILTER_ANISOTROPIC, which is linear, or as plain linear with a ratio of 1. Lookup tables, G-buffer reads and other fetches meant to be point-sampled were blended. The HLSL the recompiler emits for implicit-LOD samples copies the same rule (emit.rs, "asdesc::sampler_d3d12decides").What is in it
crates/xcl/src/gpu/desc.rs: only aniso bilinear (3) is anisotropic, and "linear" means bilinear or aniso bilinear (bit 0). Aniso point is point.crates/xcl/src/gpu/recomp/emit.rs: the same rule in the emitted HLSL.decodes_ssharpused 2 for an anisotropic filter, which encoded the bug. It uses 3 now, and checks 2 as point: with the ratio set or not, and with a linear mip filter.gpu_ps_image_sample_offset_implicit_lod_between_mipsis now a helper. It also runs asgpu_ps_image_sample_with_an_aniso_point_filter_samples_points: aniso point min / mag at a 4× ratio must give the point filter's texels.Tested
x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug for the suite, release for the runs.cargo test --workspace -- --test-threads=4at c237ebb: 742 passed, 0 failed, 41 ignored; noSKIPPEDlines (both GPU sampling tests ran).Regression run
The
gpu:line names a virtual display adapter of this machine (what #281 / #282 / #285 fix); XCL's log namesbackend 'real' – AMD Radeon RX 9060 XT (16188 MiB VRAM).main:
PR:
Not tested
AI use
desc.rsagainst Mesa's register database;radv_tex_filterin Mesa's sources;🤖 Generated with Claude Code
Mirror of xcl-dev#1117 (auto-synced, do not edit).