gpu: submit and wait for each shadow frame from the EXE #823

Merged
R0Y00 merged 1 commit from upstream-pr/829 into main 2026-11-23 09:38:59 +00:00
R0Y00 commented 2026-11-23 09:26:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:26:30Z.


Change

Refs #730 and builds on #826. Reuse the source-built shadow renderer and independent case from #773/#797. The EXE now selects the descriptor slot per frame and owns the order of the fixture imports for recording, submitting, waiting and cleanup. The runtime shares a device, command allocator, direct queue, fence and surfaces across both frames. The standalone shadow check uses the same renderer.

For each adapter, native Windows, pe_map and AOT match the ordered calls with fence values 1 and 2 and all 65,536 published color and light-depth bytes. The stale index changes exactly 170 second-frame color pixels. An unsupported device IID leaves no frame output and exits 20. An invalid second submit index returns E_INVALIDARG before reaching the queue, preserves the 32,768 first-frame bytes, releases four owned surfaces and the device, and exits 24.

Verification

Tested ea96661 on Windows 11 26200.9974, RTX 4060 Laptop GPU (NVIDIA 616.56) and WARP 10.0.26100.9818. The EXE provider ran without requesting the D3D12 debug layer. The standalone check retained its existing setup.

  • cmake --build --preset release --target cpu_shim_startup_lifted pe_map offscreen_check --parallel 7 passed.
  • ctest --preset release --no-tests=error --output-on-failure -R '^(cpu_native_shim_startup|cpu_shim_(compute|draw|texture_reuse|upload_texture|chain|shadow)_(warp|hardware)|mesh_shadow_draw_(warp|hardware))$' passed 15/15 with zero skips.
  • python -B tests/docs_links_check.py and git diff --check passed.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6556209272 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/829). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T09:26:30Z. --- ## Change Refs #730 and builds on #826. Reuse the source-built shadow renderer and independent case from #773/#797. The EXE now selects the descriptor slot per frame and owns the order of the fixture imports for recording, submitting, waiting and cleanup. The runtime shares a device, command allocator, direct queue, fence and surfaces across both frames. The standalone shadow check uses the same renderer. For each adapter, native Windows, pe_map and AOT match the ordered calls with fence values 1 and 2 and all 65,536 published color and light-depth bytes. The stale index changes exactly 170 second-frame color pixels. An unsupported device IID leaves no frame output and exits 20. An invalid second submit index returns `E_INVALIDARG` before reaching the queue, preserves the 32,768 first-frame bytes, releases four owned surfaces and the device, and exits 24. ## Verification Tested `ea96661` on Windows 11 26200.9974, RTX 4060 Laptop GPU (NVIDIA 616.56) and WARP 10.0.26100.9818. The EXE provider ran without requesting the D3D12 debug layer. The standalone check retained its existing setup. - `cmake --build --preset release --target cpu_shim_startup_lifted pe_map offscreen_check --parallel 7` passed. - `ctest --preset release --no-tests=error --output-on-failure -R '^(cpu_native_shim_startup|cpu_shim_(compute|draw|texture_reuse|upload_texture|chain|shadow)_(warp|hardware)|mesh_shadow_draw_(warp|hardware))$'` passed 15/15 with zero skips. - `python -B tests/docs_links_check.py` and `git diff --check` passed. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:59 +00:00
R0Y00 commented 2026-11-24 06:49:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T09:29:53Z.


CPU/PE and GPU review on ea96661. I reran the Release startup script and the shadow script for WARP and the RTX 4060 Laptop using the built candidate. All 24 shadow child runs passed across native Windows, pe_map and AOT. The EXE sets the frame and map arguments and preserves the submit index across the record call. The mapper binds the same imports, and the AOT bindings use 32-bit frame/map values and HRESULTs. I checked that each successful frame closes and executes its own list and signals and waits for fence 1 or 2 before readback and allocator reuse. The invalid second index is rejected before ExecuteCommandLists, preserves exactly 32,768 first-frame bytes and closes four surfaces and the device before exit 24. The stale slot differed at 170 second-frame color pixels on both adapters while light depth matched. This passes review for the tested path. One separate failure path remains unexercised: if queue Signal fails after execution, submitted has not advanced, so the normal fence accounting cannot establish that the resources are idle.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7096725818 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/829#issuecomment-7096725818). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T09:29:53Z. --- CPU/PE and GPU review on `ea96661`. I reran the Release startup script and the shadow script for WARP and the RTX 4060 Laptop using the built candidate. All 24 shadow child runs passed across native Windows, `pe_map` and AOT. The EXE sets the frame and map arguments and preserves the submit index across the record call. The mapper binds the same imports, and the AOT bindings use 32-bit frame/map values and HRESULTs. I checked that each successful frame closes and executes its own list and signals and waits for fence 1 or 2 before readback and allocator reuse. The invalid second index is rejected before `ExecuteCommandLists`, preserves exactly 32,768 first-frame bytes and closes four surfaces and the device before exit 24. The stale slot differed at 170 second-frame color pixels on both adapters while light depth matched. This passes review for the tested path. One separate failure path remains unexercised: if queue `Signal` fails after execution, `submitted` has not advanced, so the normal fence accounting cannot establish that the resources are idle.
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!823
No description provided.