Integrate mesh translation, D3D12 rendering and memory handling #2595

Closed
denn0x wants to merge 2 commits from upstream-pr/2603 into main
denn0x commented 2026-11-25 22:47:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-25T22:47:36Z.


This draft groups the renderer and shader translator changes so contributors can fetch one branch and test the components together.

  • Translate additional mesh, pixel and compute instructions, including scalar pair copies, embedded scalar tables, per-lane control flow and quad reads. Extend the runtime bindings for translated shaders.
  • Submit translated draws and indirect dispatches, track upload-buffer lifetimes, and add an opt-in path for comparing large buffer snapshots outside the draw lock.
  • Add resource retirement, memory accounting, XMem slab handling and texture layout support.
  • Present in the executable’s own window and start the render client at 1280 × 720 with frame and FPS information in the caption.

The Windows release build succeeded for the renderer, XMem, storage, stream, mesh and retirement fixture targets. The selected WARP suite recorded 59 passes and seven skips across 66 tests. Focused shader checks passed for integer pack conversion, scalar literal flow, embedded tables, mask lineage, descriptor words and quad operations.

One graphics regression remains in the full D16 image-load fixture. A pixel export that references an uninitialized entry register is rejected during input validation. Full-suite and end-to-end rendering verification are still pending. This branch uses shader-cache revision 3. Use a separate cache directory when switching from upstream.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5500495571 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2603). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-25T22:47:36Z. --- This draft groups the renderer and shader translator changes so contributors can fetch one branch and test the components together. - Translate additional mesh, pixel and compute instructions, including scalar pair copies, embedded scalar tables, per-lane control flow and quad reads. Extend the runtime bindings for translated shaders. - Submit translated draws and indirect dispatches, track upload-buffer lifetimes, and add an opt-in path for comparing large buffer snapshots outside the draw lock. - Add resource retirement, memory accounting, XMem slab handling and texture layout support. - Present in the executable’s own window and start the render client at 1280 × 720 with frame and FPS information in the caption. The Windows release build succeeded for the renderer, XMem, storage, stream, mesh and retirement fixture targets. The selected WARP suite recorded 59 passes and seven skips across 66 tests. Focused shader checks passed for integer pack conversion, scalar literal flow, embedded tables, mask lineage, descriptor words and quad operations. One graphics regression remains in the full D16 image-load fixture. A pixel export that references an uninitialized entry register is rejected during input validation. Full-suite and end-to-end rendering verification are still pending. This branch uses shader-cache revision 3. Use a separate cache directory when switching from upstream.
SimSalabimse commented 2026-11-26 00:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-25T23:16:36Z.


Host retest on 993603d8 (retire + budget + FakeUser + Render + Translate, HostCpu / MemoryGiB 40).

Vs tip bee07b90 (same recipe): tip reached in-scene UI over solid magenta (present mean ~170). This draft reaches UI over black (present mean ~0.6 late); loading/clear also black where tip showed color.

tip bee07b90 #2603 993603d8
Present mean (late) ~170 (magenta) ~0.6 (black+UI)
Pipelines translated / missing 58 / 558 55 / 94
Mesh refused DispatchMesh (~11M), forwarded 0 mesh hook: ~1.27M calls, executed 0 (not-implemented)
Run timeout ~900s, in-scene subtitle ~6882 frames / 452s / 15 fps

Shaders were not cold-cache (55 pipelines translated, 1407 textures). Scene mesh still never executes; diagnostic magenta clear looks gone.

Happy to retest once mesh executed / forwarded > 0. Until then staying on tip for daily runs.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7177347629 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7177347629). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-25T23:16:36Z. --- Host retest on `993603d8` (retire + budget + FakeUser + Render + Translate, HostCpu / MemoryGiB 40). **Vs tip `bee07b90` (same recipe):** tip reached in-scene UI over solid magenta (`present` mean ~170). This draft reaches UI over **black** (`present` mean ~0.6 late); loading/clear also black where tip showed color. | | tip bee07b90 | #2603 993603d8 | |---|---|---| | Present mean (late) | ~170 (magenta) | ~0.6 (black+UI) | | Pipelines translated / missing | 58 / 558 | 55 / 94 | | Mesh | refused DispatchMesh (~11M), forwarded 0 | mesh hook: ~1.27M calls, **executed 0** (`not-implemented`) | | Run | timeout ~900s, in-scene subtitle | ~6882 frames / 452s / 15 fps | Shaders were not cold-cache (55 pipelines translated, 1407 textures). Scene mesh still never executes; diagnostic magenta clear looks gone. Happy to retest once `mesh executed` / forwarded > 0. Until then staying on tip for daily runs.
tedin7 commented 2026-11-26 01:02:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:36:07Z.


@denn0x I tried a full Windows Server 2025 run of this branch at head 8634f27b (D3D12 WARP, MSVC 14.44.35207, dev and release presets, all targets, full ctest). It stops before the build, on two things that are quick to fix:

  1. CMake configure fails: duplicate test name. startup_image_sample_d is registered twice in CMakeLists.txt: once at line 3402 (the standalone add_test(NAME startup_image_sample_d ...) that came from main with #2082) and once through the foreach(check IN ITEMS ... image_sample_d ...) list at line 3430.

    CMake Error at CMakeLists.txt:20 (_add_test):
      _add_test given test NAME "startup_image_sample_d" which already exists in this directory.
    Call Stack (most recent call first):
      CMakeLists.txt:3431 (add_test)
    -- Configuring incomplete, errors occurred!
    

    Dropping image_sample_d from that foreach list (or the standalone pair at 3402-3403, if both run the same script) should be enough.

  2. tests/startup_buffer_address_check.py fails on this head (also on Linux, python3 tests/startup_buffer_address_check.py):

    File "tests/startup_buffer_address_check.py", line 213, in formatted_mubuf_request_controls
      assert result == 'ok', result
    AssertionError: unsupported: pixel stage reads entry VGPR v0 (an SPI input; layout not in the request) at 0x0
    

    So the formatted MUBUF request control now hits the pixel-stage SPI input refusal before the load it means to test.

Once the configure error is gone I can run the full dev + release suite on the new head and post the pass/fail list here, separated from the failures that also happen on current main on this machine (no physical GPU, no desktop session).

Commands executed:

git fetch origin pull/2603/head && git checkout FETCH_HEAD          # 8634f27b
python tests/startup_buffer_address_check.py                          # Win2025 and Linux: fails as above
cmake --preset dev                                                    # Win2025: fails as above

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178925501 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7178925501). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:36:07Z. --- @denn0x I tried a full Windows Server 2025 run of this branch at head `8634f27b` (D3D12 WARP, MSVC 14.44.35207, dev and release presets, all targets, full ctest). It stops before the build, on two things that are quick to fix: 1. **CMake configure fails: duplicate test name.** `startup_image_sample_d` is registered twice in `CMakeLists.txt`: once at line 3402 (the standalone `add_test(NAME startup_image_sample_d ...)` that came from `main` with #2082) and once through the `foreach(check IN ITEMS ... image_sample_d ...)` list at line 3430. ``` CMake Error at CMakeLists.txt:20 (_add_test): _add_test given test NAME "startup_image_sample_d" which already exists in this directory. Call Stack (most recent call first): CMakeLists.txt:3431 (add_test) -- Configuring incomplete, errors occurred! ``` Dropping `image_sample_d` from that `foreach` list (or the standalone pair at 3402-3403, if both run the same script) should be enough. 2. **`tests/startup_buffer_address_check.py` fails** on this head (also on Linux, `python3 tests/startup_buffer_address_check.py`): ``` File "tests/startup_buffer_address_check.py", line 213, in formatted_mubuf_request_controls assert result == 'ok', result AssertionError: unsupported: pixel stage reads entry VGPR v0 (an SPI input; layout not in the request) at 0x0 ``` So the formatted MUBUF request control now hits the pixel-stage SPI input refusal before the load it means to test. Once the configure error is gone I can run the full dev + release suite on the new head and post the pass/fail list here, separated from the failures that also happen on current `main` on this machine (no physical GPU, no desktop session). Commands executed: ``` git fetch origin pull/2603/head && git checkout FETCH_HEAD # 8634f27b python tests/startup_buffer_address_check.py # Win2025 and Linux: fails as above cmake --preset dev # Win2025: fails as above ``` AI-assisted; commands listed were executed locally.
roansystemlabs commented 2026-11-26 02:05:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-26T01:19:04Z.


@denn0x this draft now carries slot 57 depth-only draws without a pixel stage, pos1 as clip distance, cull and front-face state, and the wave-level execz scalar handling. Before anyone claims more slot 57 items on #2413, could you say which of these you plan to split into their own PRs, and which are open for others to take as focused slices? In particular: the depth-only mesh draw without a pixel stage with a depth readback (we could add it as a second arm of the D32 fixture we are building on #2606), and pos1 as clip distance in translate_mesh57. If you'd rather keep them, no problem, we'll stay out of that area.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179652681 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7179652681). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-26T01:19:04Z. --- @denn0x this draft now carries slot 57 depth-only draws without a pixel stage, `pos1` as clip distance, cull and front-face state, and the wave-level `execz` scalar handling. Before anyone claims more slot 57 items on #2413, could you say which of these you plan to split into their own PRs, and which are open for others to take as focused slices? In particular: the depth-only mesh draw without a pixel stage with a depth readback (we could add it as a second arm of the D32 fixture we are building on #2606), and `pos1` as clip distance in `translate_mesh57`. If you'd rather keep them, no problem, we'll stay out of that area. AI-assisted.
tedin7 commented 2026-11-27 09:36:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T09:36:54Z.


This PR now conflicts with main. Conflicting files:

  • CMakeLists.txt
  • src/startup_stubs/d3d12_draw.inl
  • src/startup_stubs/d3d12_present.inl
  • src/startup_stubs/d3d12_xs_device.cpp
  • src/xmem_mapped_pages.cpp
  • tests/startup_image_sample_l_check.py
  • tests/startup_resource_retire_title.cpp
  • tests/startup_stream_draw.cpp
  • tools/startup/gfx2hlsl.py

Could you merge main into your branch (a merge commit, no force push needed) and resolve these? Thank you.

AI-assisted; commands listed were executed locally. (git merge-tree origin/main <head>)

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7214888782 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7214888782). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-27T09:36:54Z. --- This PR now conflicts with `main`. Conflicting files: - `CMakeLists.txt` - `src/startup_stubs/d3d12_draw.inl` - `src/startup_stubs/d3d12_present.inl` - `src/startup_stubs/d3d12_xs_device.cpp` - `src/xmem_mapped_pages.cpp` - `tests/startup_image_sample_l_check.py` - `tests/startup_resource_retire_title.cpp` - `tests/startup_stream_draw.cpp` - `tools/startup/gfx2hlsl.py` Could you merge `main` into your branch (a merge commit, no force push needed) and resolve these? Thank you. AI-assisted; commands listed were executed locally. (`git merge-tree origin/main <head>`)

Pull request closed

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!2595
No description provided.