D3D12.X: a console sampler keeps its filter and border colour #1875
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1885"
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 ivall/xcl. Originally posted by veyn-sudo on 2026-11-24T22:34:08Z.
CreateSamplerX(device #61) made every sampler anisotropic with a transparent black border, whatever the desc asked for: point samplers filtered linearly, and opaque black and white borders were lost. Both fields are in the console desc and are now taken from it.What is in it (
crates/xcl/src/hle/d3d12x/device_x.rs)pc_sampler_desc, so that it can be testedA maximum anisotropy of 1 gives no anisotropic filter.
Tested
cargo test --workspace -- --test-threads=4at5824d212: 961 passed, 0 failed, 43 ignored. SKIPPED lines: 18 no wave64, 3 per-lane f16 / cvt refusals, 1 no heap windowsconsole_samplers_keep_their_filterfails with the mip filter read at +0x10 (D3D12_FILTER(21)instead of20for the title's1 1 1 2desc) and passes with +0xC;console_samplers_keep_their_border_colourRegression run
main:
PR:
Not tested
main; mip filter 0 is read as point mipsHANDOFF.mdsays "#61 CreateSamplerX (0x6C-byte desc → anisotropic PC sampler)": no longer true for every sampler.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T22:45:27Z.
Full-suite run, since this PR has no test report yet. Tested exact head
b76c075(on its basec4d37be).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu: 956 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.console_samplers_keep_their_filter,console_samplers_keep_their_border_colour.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 961 passed, 0 failed, 43 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out five tests where this PR's base has them. They fail on main689f2dbtoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures. These areheap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by lewisnic94-max on 2026-11-24T23:19:26Z.
Review: COMMENTED
I reviewed
b76c075450a3bee4d4d27ad6e9de06d0e308f933. With maximum anisotropy set to one, I crossed four minification encodings, four magnification encodings and three mip encodings. All 48 descriptors selected the expected named D3D12 filter. All four border components retained their input bits, including negative zero. The PR’s tests also exercised maximum anisotropy eight. I found no actionable defect in the descriptor conversion I exercised.I ran the independent
batch002_samplersfixture and theconsole_samplers_filter separately withcargo test --offline --locked -j 1 -p xcl --lib <filter> -- --test-threads=1 --nocapture. Across those runs, 3 passed, 0 failed, 0 ignored, and 0 skip notices. Windows 11 build 26200.9974, Ryzen 7 5800X, RTX 3080 driver 616.92, debug MSVC Rust 1.100.0. These CPU-side assertions examined the constructed descriptors. Rendered pixels and console image parity were outside the test.Codex (GPT-6) traced descriptor creation, wrote the independent matrix and checked the results.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:07:17Z.
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!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:00:45Z.
PR #1885 — Intel Arc A770 verification
Tested commit
b76c075450a3bee4d4d27ad6e9de06d0e308f933, the fetched PR head.Environment
STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave range 8–32,
DoublePrecisionFloatShaderOps=0. DXC/DXIL 1.9.2609.5,rustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized builds with debug info disabled andXCL_ADAPTER=A770.Tested
cargo build --workspaceandcargo test --workspace --no-runboth succeeded outside the GPU lock.cargo test -p xcl console_samplers_keep -- --nocapturereported 2 passed, 0 failed, 0 ignored. The two CPU tests verify point, linear, mixed and anisotropic filter encoding and preservation of all four border-colour components in the PC descriptor used byCreateSamplerX.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock. Cargo exited 101.pr1885-suite.logcontains 20 result blocks totalling 942 passed, 19 failed, 43 ignored, with 22SKIPPEDlines counted separately. Both sampler tests passed in this run too.Failures and skips
0x80070057, including FP64 cases. Four reported result mismatches in FMA overflow, FP16 high-half preservation, implicit-LOD offset sampling (25.609375 vs 26), and wave64 pixel reductions. The offset-sampling test supplies a sampler from an S# descriptor directly to the GPU runner.RSSetDepthBiasXcheck read blue at the top-right pixel where it expected green.Not tested
GPU rendering via
CreateSamplerX, retail titles or a pairedmain/PR smoke run, other GPUs, and game-data checks gated by unsetXCL_SAMPLE_*variables. The debug-layer title check returns early on this host becaused3d12SDKLayers.dllis absent.AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1885-suite.logand published this report.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:27Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:39:38Z.
A few layout and translation issues spotted in
pc_sampler_desc/sampler_x_filterwhile auditingCreateSamplerX:+0x0Cvs+0x10):pc_sampler_descreadsu(0x10)as the mip filter, but in the console extended sampler descriptor+0x0CisFilterMipand+0x10isFilterZ(volume Z filter). Reading+0x10causes 2D trilinear samplers whose Z filter isNONE/POINTto silently lose linear mip filtering (andconsole_samplerin the unit test swaps the two slots as well). Also, whenFilterMip == 0(NONE), clampingMaxLOD = MinLODpreserves disabled mip selection on PC.+0x14) and comparison filter bit:sampler_x_filteralways emits standard filtering (reduction = 0).+0x14(FilterMode:1= minimum,2= maximum) should set the D3D12 minimum (0x100) / maximum (0x180) reduction bits so min/max downsample samplers stay conservative instead of averaging.+0x40(ComparisonFunc) is an active comparison (2..=7,LESS..=GREATER_EQUAL) andFilterMode == 0, the comparison reduction bit (0x80) should be set soD3D12_FILTER_COMPARISON_*is produced (and0clamped toD3D12_COMPARISON_FUNC_NEVER).+0x18/+0x1C/+0x20are cast directly toD3D12_TEXTURE_ADDRESS_MODE, which passes console-only address modes6..=8(or0) straight through to PC D3D12 instead of mapping them to valid PC modes (1..=5, e.g.6 -> BORDER,7 | 8 -> MIRROR_ONCE,0 -> WRAP).0x6Cvs0x54):create_sampler_xchecksreadable(x, 0x6C), which can reject valid0x5C-byte descriptors from older titles near a page boundary; all fields read bypc_sampler_descend at+0x54.Imported from ivall/xcl. Originally posted by veyn-sudo on 2026-11-29T13:58:06Z.
@Kalmarv thanks. I measured point 1 and you are right: the mip filter is at +0xC. Fixed in the new head (
5824d212).What I measured: a retail title for 120 s at the old head with a temporary log of every distinct desc
CreateSamplerXgets (30 descs):That is a mip filter at +0xC and a z filter at +0x10 that follows the XY filter. I also logged the shaders' own S#s: their z filter is 0 in all 7, so they could not decide it. The test now has the title's
1 1 1 2desc as bilinear with point mips, and fails with the old offset (D3D12_FILTER(21)instead of20).Points 2–4: in all 30 descs +0x14 is 0, the comparison is 1 (
NEVER), the address modes are 1–4 and nothing past +0x50 is non-zero. So this title has no min/max or comparison samplers and no console-only address modes, and I have nothing to test those changes against. They are also howmainbehaves without this PR. I'd leave them to a separate PR with a title that uses them; #3248 is related too. MipNONE(0) did not occur either, so I have not changed it.AI use: Claude Code (Claude Opus 5.5) did the measurement, the change and this comment.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:03:52Z.
Triage (#1607) – head
5824d21No open or merged PR makes the same change. #3248 changes
dev_create_sampler_x(encoding the PC desc into an S#) downstream ofcreate_sampler_x; the two complement each other and do not overlap.No problems found in the diff:
sampler_x_filterencodes the filter the wayD3D12_ENCODE_BASIC_FILTERdoes, and the tests cover point / bilinear / trilinear / anisotropic and the border colour. The filter is still never a comparison filter when +0x40 holds a comparison function (as before this PR).The
Build and test (Windows, no GPU)check is failing on this head.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.