Recompiler: deduplicate packed ISG1 vertex input struct fields (#105) #1371
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!1371
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1371"
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?
@slopgobblercobbler on GitHub · 2026-11-24 15:19 UTC · original
slopgobblercobbler:fix/recomp-isg1-dedup→main· +105 −8 · 3 files · 1 commits · openAddresses #105 Item 4 (Packed ISG1 vertex input struct field deduplication):
When multiple packed ISG1 vertex attributes share an input register (e.g. UV0 and UV1 packing into 2-channel halves of a single register),
Mode::Vertexpreviously emitted duplicateXclInfield names (a{e.register}), causing HLSL compilation errors under DXC.What is in it
crates/xcl/src/gpu/recomp/mod.rs:vs_input_names(inputs)generates deduplicated field names with_{dup}suffixes for shared registers.vs_input_slot(vs, register, chan)routes channel indexing to the element declaring that component.crates/xcl/src/gpu/recomp/emit.rs:Mode::Vertex, emits deduplicatedXclInstruct members and indexes the corresponding field for each channel.crates/xcl/src/gpu/recomp/tests.rs:vs_packed_isg1_vertex_input_dedupverifies non-colliding fields (a0,a0_1,a1) and valid DXCvs_6_6compilation.Tested
cargo test -p xcl -- recomp(190 passed, 0 failed).cargo test --workspace(707 passed, 0 failed).upstream/main(930e8b4).Not tested
AI use
author-recomp-isg1,verify-recomp-isg1). Verified and reviewed independently.- Prevent duplicate XclIn field names a{e.register} when multiple packed ISG1 vertex elements share an input register (#105). - Deduplicate struct fields with _{dup} suffixes in vs_input_names and route channel reads to the element declaring the channel via vs_input_slot. - Add unit and HLSL translation regression tests verifying non-colliding fields and valid channel reads for packed vertex inputs.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@futurepro62 on GitHub · 2026-11-24 15:25 UTC · original · edited 2026-11-24 15:28 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
d2e5c7b(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.vs_packed_isg1_vertex_input_dedup.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 16:41 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
@LocranKing on GitHub · 2026-11-24 16:55 UTC · original
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32), adding a 60 s retail regression smoke run on clean head
d2e5c7b6e14d3f37dd547c7421c2f9b175c93888.Tested
d2e5c7b6e14d3f37dd547c7421c2f9b175c93888(clean tree, merge-base930e8b4)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo build --release --workspace: ok (exit 0)cargo test --workspace --release --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored, exit0SKIPPED(no wave64):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareRegression run
mainbaseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):PR head (
d2e5c7b6e14d3f37dd547c7421c2f9b175c93888):Not tested: debug build,
XCL_SAMPLE_*tests on this branch, AMD / native wave64 hardware, shaders with more than 16 packed vertex attributes.AI use: Antigravity (
Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.@KainanP on GitHub · 2026-11-24 18:27 UTC · original
Read at
d2e5c7bwhile doing the #1607 duplicate check for #105. I think the packed elements read the wrong channels.In the new test,
UV0is declared at register 0 with mask0xC(.zw), gets its own fieldfloat4 a0_1 : UV0, and is read asxi.a0_1[2]/xi.a0_1[3](the asserts onv6/v7). On the PC,a0_1is a separate semantic: the input assembler writes the element's components from.xup (anR32G32UV0 lands ina0_1.xy), and.zwget the defaults 0 and 1. So once the element has its own field, the channel read from it has to be shifted down by the element's first component (chan - first_set_bit(mask)), herea0_1[0]/a0_1[1]. #297's draw test shows the data in.xyof the element's own member.The test only checks the HLSL text, so it pins the unshifted index rather than catching it; a draw with distinct data in UV0 and UV1 would.
(Unrelated to #105: the PR also changes
fmt_encodefromsaturatetoclamp.)AI use: Claude Code (Claude Opus 5.5) read the diff; not run on a GPU. Checked by the user before posting.
@throny on GitHub · 2026-11-24 19:38 UTC · original
Two contributors checked independently and found that #297 #313 solves the same problem (for #105) in a different way: #1607, group D20. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@SergeAx on GitHub · 2026-11-25 20:08 UTC · original
Tested on RTX 5080 (Windows 10 22H2): with #297's
gpu_vs_packed_isg1_inputsadded tomain+ this PR (d2e5c7b), the draw gives[0.25, 0.5, 0.0, 1.0]where[0.25, 0.5, 0.75, 0.125]is expected. On PC the input layout feeds TEXCOORD1 (R32G32) into its own member's.xy, butv10/v11reada1_1[2]/a1_1[3](the register's channel), which hold the IA defaults 0/1.vs_packed_isg1_vertex_input_dedupasserts that read (v6 = asuint(xi.a0_1[2])), so it passes. The same test passes on #297 and onmain+ #313. (Claude Code, Claude Opus 5.5)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.