startup: use NEVER for ordinary translated sampler filters #2220
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2228"
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 R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T06:23:14Z.
Refs #2221, item 2. Set the ordinary translated sampler's comparison function to
NEVER, as used by the D3D12 debug layer for a non-comparison filter. The decoder still maps all eight guest comparison functions for real comparison samplers. Static samplers, dynamic heap entries and the border fallback share this decoder. Item 1 (the guest LOD fields) is being handled separately in the issue.On one Windows 2025 WARP device with the Direct3D 12 Agility SDK 1.620.2 debug layer, I created four descriptors and read the device's info queue after each call. Restoring
ALWAYSon the ordinary point sampler produced warning 1361 once. The fixed ordinary sampler, the border fallback, and an actual comparison sampler withALWAYSproduced zero instances. All four reported zero errors. Before/after info-queue measurementsctest --test-dir out/build/gpu-check-release --no-tests=error -R '^startup_(translated_sampler_bindings|sampler_comparison)$': 2/2 passed. Restoring the previous field toALWAYSmade each regression test fail for the ordinary descriptor.python -B tests/startup_sampler_heap_check.py draw <dxc> <offscreen_check> warpon Windows 2025. Readback passed with the debug layer enabled, zero errors and zero warnings in the ordinary heap draws. The fixture now reports a regression if warning 1361 appears. Native tests, WARP and mutation controlbf9bf8bc. Both passed the readbacks and existing negative controls. The local system debug layer was unavailable; the warning counts above come from the hosted runs.AI-assisted with Codex (GPT-6.2 Astra xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:26:55Z.
Review: COMMENTED
Review of head
bf9bf8bc0196147ab2ba6ce37b11423f570861aa.Result: no P1, no P2.
Scope:
translated_sampler_bindings.hnow setsComparisonFunc = NEVERfor ordinary (non-comparison) samplers. The comparison branch still maps the 3-bit field with+1, which covers NEVER..ALWAYS. That matchesD3D12_COMPARISON_FUNC. Static samplers, dynamic heap entries andborder_sampler()all go throughdecode_sampler/dynamic_sampler, so one change covers all three. I checked for sibling sites withrg -n "COMPARISON_FUNC_ALWAYS|ComparisonFunc *= *" src tests. No other ordinary-sampler decoder insrcsetsALWAYS. The remainingALWAYShits are depth/stencil state, which is unrelated.Tests:
startup_sampler_comparison_check.cppandstartup_translated_sampler_bindings_check.cppflip the expected value from 8 to 1 for static and dynamic descriptors. The latter also adds aborder_samplerassertion.startup_sampler_heap_check.pyfails the draw run ifD3D12 1361:appears on stderr. This is a real behavioural guard.Commands executed locally in the review worktree:
git diff --stat origin/main...HEAD: 4 files, 7 insertions, 4 deletions.python3 tests/docs_links_check.py: passed (412 links).python3 tests/bidi_controls_check.py: passed (1505 files).git diff --check origin/main...HEAD: clean.python3 -I -m py_compile tests/startup_sampler_heap_check.py: OK.gh pr checks: the Linux Python checks and the gfx1013 fixtures pass. The Windows build was still pending when I checked.Not run here: the C++ tests need the D3D12 headers and a Windows build, and this host has neither. I did not run the mutation (restoring
ALWAYS) locally. The PR body reports that mutation failing both C++ checks and the debug-layer warning, and the Windows CI job should confirm it.Nits (non-blocking):
D3D12 1361:string match in the heap check depends on the debug-layer message format. A short comment saying so would help the next reader.Please wait for the pending Windows CI job before merging.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T06:32:00Z.
Added the explanation beside the assertion in
58ddee3d. The numeric prefix comes fromoffscreen_checkwhen it prints the D3D12 info queue. The WARP draw passed again after the comment change.The Windows 2025 sampler run built the implementation with MSVC, passed both native descriptor checks and the debug-layer WARP draw, and confirmed that restoring ordinary ALWAYS fails both descriptor checks. A separate WARP info-queue probe observed one message 1361 with the restored ordinary descriptor and zero with the fixed descriptor, fallback sampler and comparison ALWAYS control. The upstream run on the comment revision is underway.