Integrate mesh translation, D3D12 rendering and memory handling #2603

Closed
github-bot wants to merge 2 commits from github-bot/gh-2603 into main AGit
Owner

@⁠denn0x on GitHub · 2026-11-25 22:47 UTC · original
denn0x:startup/rendering-integration → main · +43703 −2922 · 199 files · 2 commits · closed without merging

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.

**@⁠denn0x** on GitHub · 2026-11-25 22:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2603) `denn0x:startup/rendering-integration` → `main` · +43703 −2922 · 199 files · 2 commits · closed without merging 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:06:36 +00:00
Author
Owner

@⁠SimSalabimse on GitHub · 2026-11-25 23:16 UTC · original

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.

**@⁠SimSalabimse** on GitHub · 2026-11-25 23:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7177347629) 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.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 00:36 UTC · original

@⁠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.

**@⁠tedin7** on GitHub · 2026-11-26 00:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7178925501) @⁠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.
Author
Owner

@⁠roansystemlabs on GitHub · 2026-11-26 01:19 UTC · original

@⁠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.

**@⁠roansystemlabs** on GitHub · 2026-11-26 01:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7179652681) @⁠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.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-27 09:36 UTC · original

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>)

**@⁠tedin7** on GitHub · 2026-11-27 09:36 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2603#issuecomment-7214888782) 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>`)
github-bot closed this pull request 2026-11-27 11:08:00 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.