Translate mesh PARAM0 exports and verify interpolated vertex colors end to end #546

Manually merged
github merged 1 commit from gh-pr/546/head into gh-pr/546/base 2026-11-26 22:00:36 +00:00
Owner

@⁠descent81 on GitHub · 2026-11-22 10:30 UTC · original
descent81:mesh/interpolated-attribute → main · +102 −4 · 6 files · 1 commits · merged 2026-11-22 10:51 UTC

A position export determines where a triangle lands. This adds a bounded four-component PARAM0 export to the specialized mesh translator so a translated pixel shader can consume data from its vertices. The source-built fixture fetches indexed positions and a second stream of runtime RGB values from the same SRV, exports the attribute, interpolates attr0 and packs MRT0. The same compiled stages draw two different palettes.

Verified CPU reference images

Why the result distinguishes the stages

The triangle extends beyond the viewport. Its clip positions and vertex amplitudes yield two exact ramps at the 32×32 pixel centers. A CPU oracle evaluates those ramps directly and compares every RGBA byte. Swapping the uploaded red and green vertex values transposes the ramps without moving any vertex. Keeping the old reference produces exactly 992 pixel mismatches; the other 32 centers have equal red and green. The primitive and position trace still matches.

Scope and verification

  • Specializes one full float4 attribute for the existing single-triangle profile. Rejects duplicate exports, partial component writes and missing vertex attributes.
  • LLVM 15 assembled the gfx1013 wave64 mesh fixture; the decoded container reproduced the expected lowering.
  • RTX 4060 and Windows WARP passed with trace instrumentation on and off. All six indexed, entry and attribute mesh CTest entries passed locally.
  • Based on main at bcfd456. Shares the optional pixel-source argument used by #544 and tests a separate interface: runtime data crosses the rasterizer from translated mesh to translated pixel stage.
**@⁠descent81** on GitHub · 2026-11-22 10:30 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/546) `descent81:mesh/interpolated-attribute` → `main` · +102 −4 · 6 files · 1 commits · merged 2026-11-22 10:51 UTC A position export determines where a triangle lands. This adds a bounded four-component PARAM0 export to the specialized mesh translator so a translated pixel shader can consume data from its vertices. The source-built fixture fetches indexed positions and a second stream of runtime RGB values from the same SRV, exports the attribute, interpolates attr0 and packs MRT0. The same compiled stages draw two different palettes. ![Verified CPU reference images](https://raw.githubusercontent.com/descent81/Xbox2Windows/mesh/interpolated-attribute/docs/mesh-attribute-reference.png) ## Why the result distinguishes the stages The triangle extends beyond the viewport. Its clip positions and vertex amplitudes yield two exact ramps at the 32×32 pixel centers. A CPU oracle evaluates those ramps directly and compares every RGBA byte. Swapping the uploaded red and green vertex values transposes the ramps without moving any vertex. Keeping the old reference produces exactly 992 pixel mismatches; the other 32 centers have equal red and green. The primitive and position trace still matches. ## Scope and verification - Specializes one full float4 attribute for the existing single-triangle profile. Rejects duplicate exports, partial component writes and missing vertex attributes. - LLVM 15 assembled the gfx1013 wave64 mesh fixture; the decoded container reproduced the expected lowering. - RTX 4060 and Windows WARP passed with trace instrumentation on and off. All six indexed, entry and attribute mesh CTest entries passed locally. - Based on main at `bcfd456`. Shares the optional pixel-source argument used by #544 and tests a separate interface: runtime data crosses the rasterizer from translated mesh to translated pixel stage.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:00:34 +00:00
github manually merged commit 94bd503ef7 into gh-pr/546/base 2026-11-26 22:00:36 +00:00
Author
Owner

@⁠RonLogic on GitHub · 2026-11-22 11:51 UTC · original

Independent reproduction requested in #218. I built the submitted head 94bd503ef7d073dcdebae97b4f00c88c8987303e on Windows 11 build 26300.9974 with x64 MSVC 19.52.37029.0. The RTX 4070 (32.0.16.2124) and WARP (10.0.26100.9818) both ran with the D3D12 debug layer enabled. All four mesh_attribute_draw_* and mesh_indexed_draw_* tests passed. Both uploaded palettes matched all 1,024 pixels with trace on and off. The stale-palette reference failed at exactly 992 pixels on each adapter, and the geometry trace still matched.

**@⁠RonLogic** on GitHub · 2026-11-22 11:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/546#issuecomment-7078718024) Independent reproduction requested in #218. I built the submitted head `94bd503ef7d073dcdebae97b4f00c88c8987303e` on Windows 11 build 26300.9974 with x64 MSVC 19.52.37029.0. The RTX 4070 (32.0.16.2124) and WARP (10.0.26100.9818) both ran with the D3D12 debug layer enabled. All four `mesh_attribute_draw_*` and `mesh_indexed_draw_*` tests passed. Both uploaded palettes matched all 1,024 pixels with trace on and off. The stale-palette reference failed at exactly 992 pixels on each adapter, and the geometry trace still matched.
This discussion has been locked. Commenting is limited to contributors.
No description provided.