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

Merged
descent81 merged 1 commit from upstream-pr/546 into main 2026-11-22 10:51:36 +00:00
descent81 commented 2026-11-22 10:30:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by descent81 on 2026-11-22T10:30:44Z.


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6541317285 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/546). Originally posted by [descent81](https://github.com/descent81) on 2026-11-22T10:30:44Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:43:37 +00:00
RonLogic commented 2026-11-24 06:48:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-22T11:51:45Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7078718024 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/546#issuecomment-7078718024). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-22T11:51:45Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!540
No description provided.