Repository navigation
Conversation
Match the HLSL recompiler (recomp/emit.rs) in Lw::interp_gfx: - Store each PS input's DXBC component_type (u32) in GfxCtx::ps_in instead of a bool. - Convert UINT (1) with CastOp::UIToFP and SINT (2) with CastOp::SIToFP to f32 for v_interp_p2_f32 and v_interp_p2_f16 before bitcasting/converting to f16, instead of returning raw integer bits. - Keep raw bitcast for v_interp_mov_f32 (preserving integer selector bits as in xcl-dev#249). Part of xcl-dev#1269 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Tested Both focused fixtures passed on STOR-WINLAB at
Intel Arc A770 driver cargo test --locked -p xcl --lib --no-run
$exe = 'L:/XclTooling/pr2011-990b9d4-t3-76a0502d/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
$env:XCL_DXC_DIR = "$env:LOCALAPPDATA/XclTooling/dxc-1.9.2609/bin/x64"
& $exe 'gpu::dxil::lower_gfx::tests::ps_interp_p2_converts_int_inputs_and_mov_keeps_raw_bits' --exact --nocapture --test-threads=1
# GPU invocation ran in a fresh PowerShell process with -ExecutionPolicy RemoteSigned.
$env:XCL_ADAPTER = 'A770'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $exe 'gpu::dxil::lower_gfx::tests::gpu_ps_interp_int_component_types_match_hlsl' --exact --nocapture --test-threads=1
}Not tested — Full workspace suite, retail-title smoke runs, other adapters, or native wave64 execution. AI use — T3 Code / Codex ( |
|
Tested:
Head |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, not the native-Windows path: this PR's 2 new tests pass, none skipped. Tested
Not tested
AI use
|
What is in it
Matches the HLSL recompiler (
recomp/emit.rs) for integer pixel-shader inputs in the direct DXIL translator'sLw::interp_gfx()(crates/xcl/src/gpu/dxil/lower_gfx.rs):GfxCtx::ps_infromVec<(Sig, bool)>toVec<(Sig, u32)>to preserve each PS input's DXBCcomponent_type(matchingGfxCtx::targets).Lw::interp_gfx():v_interp_p2_f32andv_interp_p2_f16, convertsUINT(component_type == 1) viaCastOp::UIToFPandSINT(component_type == 2) viaCastOp::SIToFPtof32before bitcasting toi32(v_interp_p2_f32) or converting viaself.to_f16(v_interp_p2_f16). Previously,interp_gfxignored the input type and returned raw integer bits (asuint(i)instead ofasuint((float)i)forp2_f32, and bitcast integer bits as float beforeto_f16forp2_f16).bitcast(no int-to-float cast) forv_interp_mov_f32, preserving raw integer selector bits as in#249.gpu::dxil::lower_gfx::tests:ps_interp_p2_converts_int_inputs_and_mov_keeps_raw_bits: CPU test validating DXIL and checking disassembled IR acrossUINT(1),SINT(2), andF32(3) inputs forv_interp_p2_f32,v_interp_p2_f16(both lo and hiOP_SEL[3]), andv_interp_mov_f32.gpu_ps_interp_int_component_types_match_hlsl: GPU draw test (guarded bygraphics::tests::draw_ready()) verifying direct DXIL matches HLSL and exact expected pixel values ([5.0, -3.0, 1.0, -2.5]forp2_f32+mov_f32,[7.0, -4.0, 7.0, -4.0]forp2_f16lo + hi).Part of #1269
Tested
Environment: Windows 11 Home 26200, Intel Core i5-11400F, 32 GB RAM, NVIDIA GeForce RTX 4060 8 GB (driver 621.14, wave32), Rust 1.100.0, DXC
1.9.2609.5(01b62ad4).cargo test -j 4 -p xcl --lib gpu::dxil::lower_gfx::tests::ps_interp_p2_converts_int_inputs_and_mov_keeps_raw_bits -- --nocapture): 0 passed, 1 failed (p2_f32 uintemitted rawbitcast i32 to floatwithoutuitofp i32).cargo test --release -p xcl --lib gpu::dxil::lower_gfx::tests -- --nocapture): 2 passed, 0 failed (dxil 1.9.2609.5validation + IR checks + GPU draw parity vs HLSL).XCL_ADAPTER="Microsoft Basic Render Driver"): 2 passed, 0 failed (ps_interp_p2_converts_int_inputs_and_mov_keeps_raw_bitsran and passed;gpu_ps_interp_int_component_types_match_hlslcleanly skipped viadraw_ready()withSKIPPED ...: no GPU).cargo build --release --workspaceandcargo test --release --workspace -- --test-threads=4 --nocapture): 1,156 passed, 0 failed, 46 ignored across 21 test binaries (1100inxcllib,56across the remaining 20 binaries), with 27SKIPPEDlines on this RTX 4060:no wave64(RTX 4060 is wave32-only)per-lane form: refused(wave32 f16 arithmetic, f16 packed, f32 conversions)no d3d12SDKLayers.dll/no D3D12 debug layercannot disable the driver cache(Windows Developer Mode not enabled)no heap windowsRegression run
Paired 60 s runs via
scripts/smoke.ps1on cleanorigin/main(6987e496) and clean PR head (36e1c899):Main (
6987e496c35653f9ccc9dbdc1f1d342734306811):PR (
36e1c89959d237dc7ea753a42d6c6edaebc1471b):Not tested
no wave64skips on RTX 4060), D3D12 debug layer tests (2 skips withoutd3d12SDKLayers.dll), driver cache disable toggle (1 skip without Windows Developer Mode), and heap-window OOM fallback (1 skip withoutXCL_HEAP_WINDOWS).title: 29640639, and direct DXIL graphics mode (XCL_DIRECT_DXIL=all) on a retail title shader usingv_interp_p2_*on integer ISG1 attributes.AI use
Google Antigravity (Gemini 4 Neon) wrote the
interp_gfxfix, regression tests, and this PR description. All pre-fix/post-fix CPU and GPU tests, WARP skip checks, full release workspace tests, paired 60 s smoke runs, andscripts/pr_check.py --localvalidation were run locally on this machine.