Recompiler: an aniso point sampler filter samples points, not linearly #1117
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1117
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1117/head"
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?
@emirduran707 on GitHub · 2026-11-24 11:57 UTC · original
emirduran707:sampler-aniso-point→main· +32 −8 · 3 files · 1 commits · merged 2026-11-25 10:57 UTCAn 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=4atc237ebb: 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
@thehollowedone on GitHub · 2026-11-24 12:04 UTC · original
Independent NVIDIA check at c237ebb, Windows 11, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11. The workspace build, descriptor test, and both pixel-readback tests passed with zero skips. I repeated the pixel tests with Graphics Tools enabled in the scratch runner. Both draws left the D3D12 info queue empty.
Keeping the new fixture, I restored the parent’s emitter alone, then its emitter and descriptor code together. Both controls reached the draw with an empty info queue and failed the pixel assertion at (0,0). Expected 26, observed 25.75 with the older emitter alone and 6.904297 with both older files.
Synthetic inputs only. AI-assisted. Codex (GPT-6) ran the tests and added the scratch validation check.
@emirduran707 on GitHub · 2026-11-24 12:06 UTC · original
Thanks @thehollowedone, that also confirms that both halves are needed (the emitter alone still blends at 25.75).
The failed
CIrun is a timing flake outside this change:hle::kernelx::tests::fine_timer_makes_short_sleeps_shortmeasuredSleep(1)at 5.198 ms against its 5 ms limit on the runner (job log of run 45388910570). It passes locally, and this PR doesn't touch kernelx or the timer. Could a maintainer re-run the job? I can't from a fork.AI-assisted (Claude Code, Claude Opus 5.5).
@throny on GitHub · 2026-11-24 12:27 UTC · original
Test run of
c237ebbon NVIDIA Ada, merged ontomain47efa2e(clean merge): pass.Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug.XCL_SAMPLE_*unset.cargo build --workspace && cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (lib: 699 / 0 / 21), first run.SKIPPEDon this adapter:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).gpu_ps_image_sample_with_an_aniso_point_filter_samples_pointsruns on the GPU here and passes, as does the existing implicit-LOD test it shares its body with.Not tested
main's code (no negative control).AI use
@JoaoPauluu on GitHub · 2026-11-24 13:56 UTC · original
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.c237ebbas it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).gpu::recomp::tests::gpu_ps_image_sample_with_an_aniso_point_filter_samples_points: ok, no SKIPPED.Not tested
AI use
@wanchudao on GitHub · 2026-11-24 15:42 UTC · original
Tested —
c237ebbon Windows 11 Pro build 26300, RTX 3070 Ti (driver 610.88),rustc 1.100.0, MSVC 14.44.35207, and DXC 1.9.2602.17.
cargo test -p xcl --lib gpu_ps_image_sample_with_an_aniso_point_filter_samples_points -- --nocaptureResult: 1 passed, 0 failed, 0 ignored, 719 filtered out. The test's GPU guard reports
an early return as
SKIPPED. The log has no such line. This adds an RTX 3070 Ti runof the synthetic sampler test.
Not tested — AMD hardware or whether this filter is selected in a retail run.
AI use — DeepSeek Harness (DeepSeek V4.1 Flash) ran the test and drafted this report.
OpenAI Codex (GPT-6.2 Sol) checked the archived result and revised it.
@DavidM1911 on GitHub · 2026-11-25 08:15 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@iGoldenNinja on GitHub · 2026-11-25 11:24 UTC · original
Independent RTX 5080 before/after on the merge, Windows 11 Pro 25H2 (26200.9974), NVIDIA driver 617.14, Rust 1.98.1, DXC/DXIL 1.9.2609.5. On first parent
c55ba167295333c81b7024a307e654ec818c475fwith only the sampler tests copied, the aniso-point fixture failed on actual GPU readback at (0,0), returning 6.904297 for 26. Cleanf087b998d0d51a9f11bbfa0761967a63e778edd9passed all 256 pixel checks, the ordinary implicit-LOD sampling control and the S# decoder. GPU cases ran without skips. Last verified stage was synthetic D3D12 pixel readback. Pinned report