Link translated indexed mesh and pixel shaders and verify the complete draw #538

Merged
descent81 merged 1 commit from upstream-pr/544 into main 2026-11-22 10:51:18 +00:00
descent81 commented 2026-11-22 10:20:22 +00:00 (Migrated from github.com)

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


The indexed mesh fixture already verifies vertex fetches and primitive exports against a CPU reference. Its pixel stage returns a fixed green. This test runs the translated indexed mesh stage together with a translated scalar-buffer color program in one D3D12 pipeline.

RTX 4060 target readbacks

Left to right: baseline, color upload changed, one vertex moved, and red/blue packing deliberately exchanged. Captured from RTX 4060 readback and enlarged 4×. The fourth panel uses the baseline upload and geometry.

Linkage failure found by the integration test

On the parent code both WARP and RTX 4060 rejected pipeline creation. D3D12 debug message 666 reported a missing TEXCOORD0. The constant-buffer pixel program declared that input even though its instructions never interpolated an attribute or sampled a texture. The mesh stage correctly exports positions. The pixel translator now omits that parameter when it has neither sampled bindings nor interpolation.

Observable checks

  • Pixel constants occupy bytes 64–79 of the existing b0 upload, immediately after the mesh matrix. Changing only those constants recolors all 276 covered pixels. All 748 background pixels keep their clear value.
  • Moving one vertex changes triangle coverage from 276 to 180 pixels at the original color. An independent pixel-center edge test supplies the full RGBA reference for each 32×32 target.
  • Switching the red and blue source registers in the translated packed pixel export preserves the mesh trace and produces exactly 276 mismatches against the baseline. Altering the expected primitive index separately triggers the mesh trace check.
  • Every positive case runs with mesh trace instrumentation enabled and disabled.

Local verification

Built on Windows from base 92e80ed. All six CTest entries for mesh entry, indexed mesh and the linked pipeline passed across RTX 4060 and WARP. The full LLVM pixel binary fixture suite also passed. The screenshot capture hook was local to the measurement build and was removed before the final build and six-test rerun.

This exercises source-built AMD instruction fixtures, a specialized indexed mesh and a constant-buffer pixel export. It demonstrates stage linkage and readback for that profile.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6541217716 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/544). Originally posted by [descent81](https://github.com/descent81) on 2026-11-22T10:20:22Z. --- The indexed mesh fixture already verifies vertex fetches and primitive exports against a CPU reference. Its pixel stage returns a fixed green. This test runs the translated indexed mesh stage together with a translated scalar-buffer color program in one D3D12 pipeline. ![RTX 4060 target readbacks](https://raw.githubusercontent.com/descent81/Xbox2Windows/15fb5c7/docs/mesh-pipeline-readback.png) Left to right: baseline, color upload changed, one vertex moved, and red/blue packing deliberately exchanged. Captured from RTX 4060 readback and enlarged 4×. The fourth panel uses the baseline upload and geometry. ## Linkage failure found by the integration test On the parent code both WARP and RTX 4060 rejected pipeline creation. D3D12 debug message 666 reported a missing TEXCOORD0. The constant-buffer pixel program declared that input even though its instructions never interpolated an attribute or sampled a texture. The mesh stage correctly exports positions. The pixel translator now omits that parameter when it has neither sampled bindings nor interpolation. ## Observable checks - Pixel constants occupy bytes 64–79 of the existing b0 upload, immediately after the mesh matrix. Changing only those constants recolors all 276 covered pixels. All 748 background pixels keep their clear value. - Moving one vertex changes triangle coverage from 276 to 180 pixels at the original color. An independent pixel-center edge test supplies the full RGBA reference for each 32×32 target. - Switching the red and blue source registers in the translated packed pixel export preserves the mesh trace and produces exactly 276 mismatches against the baseline. Altering the expected primitive index separately triggers the mesh trace check. - Every positive case runs with mesh trace instrumentation enabled and disabled. ## Local verification Built on Windows from base `92e80ed`. All six CTest entries for mesh entry, indexed mesh and the linked pipeline passed across RTX 4060 and WARP. The full LLVM pixel binary fixture suite also passed. The screenshot capture hook was local to the measurement build and was removed before the final build and six-test rerun. This exercises source-built AMD instruction fixtures, a specialized indexed mesh and a constant-buffer pixel export. It demonstrates stage linkage and readback for that profile.
upstream-sync closed this pull request 2026-11-24 06:43:36 +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:42Z.


Independent reproduction requested in #218. I built the submitted head 15fb5c7cca32ac570f2eb0bd515b87b87c3acbe4 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_pixel_pipeline_* and mesh_indexed_draw_* tests passed. The moved-vertex reference matched all 1,024 pixels on both adapters. The red/blue register-swap control returned the expected draw mismatch on exactly the 276 covered pixels; the primitive trace still matched.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7078717395 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/544#issuecomment-7078717395). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-22T11:51:42Z. --- Independent reproduction requested in #218. I built the submitted head `15fb5c7cca32ac570f2eb0bd515b87b87c3acbe4` 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_pixel_pipeline_*` and `mesh_indexed_draw_*` tests passed. The moved-vertex reference matched all 1,024 pixels on both adapters. The red/blue register-swap control returned the expected draw mismatch on exactly the 276 covered pixels; the primitive trace still matched.
rwZephyr commented 2026-11-24 06:48:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rwZephyr on 2026-11-22T19:13:17Z.


Independent AMD verification of the merged mesh_pixel_pipeline fixture. AI-assisted report. The tests ran locally on upstream main at edc2e54e7e75fcd7c0f13e98b47ba119d9a08268.

Windows 11 25H2 x64 build 26200.9974, MSVC 19.44.35230, Windows SDK 10.0.26100, DXC 1.8.2502.8, Python 3.12.10. The renderer confirmed RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP (1414:008c, 10.0.26100.9818). Both reported debug_layer=unavailable.

With the local toolchain loaded, $intakePython pointing to the Python environment, and debug CRT DLLs staged beside the renderer:

cmake --preset dev "-DINTAKE_PYTHON=$intakePython"
cmake --build --preset dev --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT'
ctest --preset dev --no-tests=error -R '^mesh_pixel_pipeline_(hardware|warp)$' -V

CTest passed 2/2 with zero skips. Each backend matched all 1,024 pixels in each of six positive draws, including the moved-vertex reference. The fixture caught the expected red/blue register-swap failure at exactly 276 pixels and accepted the mesh export trace. No unexpected mismatches.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084208663 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/544#issuecomment-7084208663). Originally posted by [rwZephyr](https://github.com/rwZephyr) on 2026-11-22T19:13:17Z. --- Independent AMD verification of the merged `mesh_pixel_pipeline` fixture. AI-assisted report. The tests ran locally on upstream `main` at `edc2e54e7e75fcd7c0f13e98b47ba119d9a08268`. Windows 11 25H2 x64 build `26200.9974`, MSVC `19.44.35230`, Windows SDK `10.0.26100`, DXC `1.8.2502.8`, Python `3.12.10`. The renderer confirmed RX 9070 XT (`1002:7550`, driver `32.0.32029.2010`) and WARP (`1414:008c`, `10.0.26100.9818`). Both reported `debug_layer=unavailable`. With the local toolchain loaded, `$intakePython` pointing to the Python environment, and debug CRT DLLs staged beside the renderer: ```powershell cmake --preset dev "-DINTAKE_PYTHON=$intakePython" cmake --build --preset dev --target offscreen_check $env:XBOX2WINDOWS_ADAPTER = 'RX 9070 XT' ctest --preset dev --no-tests=error -R '^mesh_pixel_pipeline_(hardware|warp)$' -V ``` CTest passed 2/2 with zero skips. Each backend matched all 1,024 pixels in each of six positive draws, including the moved-vertex reference. The fixture caught the expected red/blue register-swap failure at exactly 276 pixels and accepted the mesh export trace. No unexpected mismatches.
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!538
No description provided.