Repository navigation
Conversation
|
Independent static code audit of Summary: Looks clean
Minor defensive edge cases (
|
|
Independent native Windows/MSVC + NVIDIA validation at Tested
Additional measured interleaved-mask case and fix The fix and GPU regression are in #309, stacked on this PR; your implementation and authorship are preserved in the first commit. Its clean head SKIPPED / Not tested AI use |
…eir own (ivall#105) A console vertex shader whose input signature packs two elements into one register (TEXCOORD0 in .xy and TEXCOORD1 in .zw of r1) declared `float4 a1` once per element in `XclIn`: a member declared twice, which DXC rejects (duplicate member 'a1'), so the pipeline had no VS. Each packed element now gets its own member, `a{register}_{first}`, with the components of its mask; the fetch-shader VGPRs v[b + c] read the element that covers component c (TEXCOORD1.x in the register's z), and a component no element covers reads 0. An element alone in its register keeps `a{register}` as a 4-vector, so the HLSL of every other shader is unchanged. Tests: vs_packed_isg1_inputs_are_members_of_their_own (HLSL, DXC compile) and gpu_vs_packed_isg1_inputs (draw on the GPU with an input layout of separate R32G32 elements). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a5b7825 to
34f1386
Compare
|
Tested
Not tested AMD and retail titles on this machine. The author reports separate RX 6800 tests and retail smoke results at the same head. Author’s results AI use Codex with GPT-6.2 Sol ran the tests and drafted this report. |
Part of #105 (item 4, "packed
ISG1vertex inputs sharing a register emit duplicateXclInfield names (a{e.register}) inMode::Vertex").A console vertex shader can have two input elements packed into one register, for example TEXCOORD0 in
.xyand TEXCOORD1 in.zwof r1.Mode::Vertexdeclaredfloat4 a1once per element, soXclInhad the same member twice. DXC rejects that (error: duplicate member 'a1'), so the pipeline ended up with no VS. Now each packed element gets its own member,a{register}_{first}, sized to the components in its mask. Fetch-shader VGPRv[b + c]reads the element that covers componentc, so TEXCOORD1.x lands in the register's z, as on the console. A component that no element covers reads0u. An element alone in its register keepsfloat4 a{register}, so every other shader's HLSL stays the same.The other leftovers of #105 are covered elsewhere: items 1 and 4 by #134 and #202, item 2 by #117 and #149 (merged), item 3 by #123 (merged). The Geometry-mode
xcl_vinnote in item 3 is by design in #215, which puts the pre-fetched GS vertices in window 0.What is in it
crates/xcl/src/gpu/recomp/emit.rs:vs_input_fields/VsInputFieldname theXclInmembers and the component range each one covers. TheMode::Vertexstruct and the VGPR initialisers use them.crates/xcl/src/gpu/recomp/tests.rs:vs_packed_isg1_inputs_are_members_of_their_own: checks the HLSL members and VGPR reads (masks0x3+0xC, and0x3+0x4where.wis uncovered) and compiles both with DXC.gpu_vs_packed_isg1_inputs: draws on the GPU with an input layout of three separateR32G32_FLOATelements. Every pixel must be (TEXCOORD0.xy, TEXCOORD1.xy).Tested
stable-x86_64-pc-windows-gnuwith llvm-mingw clang), debug, DXC 1.9.2609.5 (dxcompiler + dxil from the GitHub release).origin/main'semit.rs): both new tests FAIL.gpu_vs_packed_isg1_inputspanics withdxc: hlsl.hlsl:466:12: error: duplicate member 'a1'.vs_packed_isg1_inputs_are_members_of_their_own,gpu_vs_packed_isg1_inputs,gpu_graphics_vs_ps_drawandvs_system_values_in_isg1_registerspass on the RX 6800.cargo test --workspace --exclude testgame-mw --no-fail-fast -- --test-threads=4: 651 passed, 2 failed, 40 ignored, noSKIPPEDGPU tests. Both failures also fail on unmodifiedmainwith this toolchain:pe::tests::parses_own_test_binary_tls: the gnu/llvm-mingw test binary has no TLS directory.e2e::test_title_runs_and_game_folder_is_untouched: it needstestgame_mw.dll, andtestgame-mwis excluded because it doesn't build with this toolchain.cargo clippy -p xcl --all-targets: no warnings on the added lines.Regression run
Windows 11, Ryzen 9 5900X, AMD Radeon RX 6800, Rust stable
x86_64-pc-windows-msvc(VS 2022 Build Tools, link.exe),cargo build --release -p xcl,scripts/smoke.ps1 -Seconds 45, one run at a time under a RAM watchdog.main (a6f5f7a, current
origin/main, this PR's base):PR (head commit, no local changes):
No regression: 728 frames against 828 on its base, no device removals or crashes, peak commit 15154 MB against 15144 MB. Frame counts move by about 10 % between runs of the same commit on this machine (earlier runs of
maingave 843, 709 and 828).Rebased onto current
main(a6f5f7a): the one conflict, ingpu/recomp/tests.rs, is resolved by keeping both tests. On the rebased head, built withstable-x86_64-pc-windows-msvc,cargo test -p xcl --lib recomppasses: 184 passed, 0 failed, 18 ignored, includingvs_packed_isg1_inputs_are_members_of_their_ownandgpu_vs_packed_isg1_inputson the RX 6800.Not tested
runner::options, which picks it on such adapters).AI use
🤖 Generated with Claude Code