Add geometry shader mesh fallback for GPUs without mesh shaders #2241

Open
ohwell3 wants to merge 2 commits from upstream-pr/2251 into main
ohwell3 commented 2026-11-25 11:20:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ohwell3 on 2026-11-25T11:20:59Z.


Adds a geometry shader fallback for GPUs that do not support D3D12 mesh shaders, allowing XCL's geometry/NGG recompiler path to use a compute-generated record buffer followed by a point-list vertex/geometry shader pass.

What is in it

  • emit.rs, pso.rs, runner.rs, tests.rs: geometry fallback translation, pipeline selection, execution and synthetic GPU coverage.
  • Runtime integration, record-buffer handling and allocator/reset handling for the fallback path.
  • The change spans multiple connected runtime and test files because the fallback requires the compute producer, record consumer, pipeline setup and execution lifecycle to work together.

Tested

  • GPU: AMD Radeon RX 580 8 GB, physical adapter with mesh shader tier unavailable.
  • Synthetic two-pass fallback GPU test with pixel readback.
  • Extended synthetic fallback soak: 2,271 / 2,271 runs passed over 30 minutes, with no device-removal errors.
  • DXC compilation and generated geometry-shader output checks.
  • git diff --cached --check: clean before commit.

Regression run

  • Not performed on a retail title.

Not tested

  • Full workspace test suite.
  • End-to-end integration through a real title's command-list path.
  • Full PSO/pixel-readback verification of the SV_PrimitiveID interface.
  • Compatibility or gameplay with any retail title.

AI use

  • ChatGPT (GPT-6): assisted with code development, troubleshooting, testing analysis and PR description drafting. The contributor is responsible for reviewing and understanding the submitted changes.
<!-- greyfinch-sync:ivall/xcl:issue:5490351323 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2251). Originally posted by [ohwell3](https://github.com/ohwell3) on 2026-11-25T11:20:59Z. --- Adds a geometry shader fallback for GPUs that do not support D3D12 mesh shaders, allowing XCL's geometry/NGG recompiler path to use a compute-generated record buffer followed by a point-list vertex/geometry shader pass. **What is in it** - `emit.rs`, `pso.rs`, `runner.rs`, `tests.rs`: geometry fallback translation, pipeline selection, execution and synthetic GPU coverage. - Runtime integration, record-buffer handling and allocator/reset handling for the fallback path. - The change spans multiple connected runtime and test files because the fallback requires the compute producer, record consumer, pipeline setup and execution lifecycle to work together. **Tested** - GPU: AMD Radeon RX 580 8 GB, physical adapter with mesh shader tier unavailable. - Synthetic two-pass fallback GPU test with pixel readback. - Extended synthetic fallback soak: 2,271 / 2,271 runs passed over 30 minutes, with no device-removal errors. - DXC compilation and generated geometry-shader output checks. - `git diff --cached --check`: clean before commit. **Regression run** - Not performed on a retail title. **Not tested** - Full workspace test suite. - End-to-end integration through a real title's command-list path. - Full PSO/pixel-readback verification of the `SV_PrimitiveID` interface. - Compatibility or gameplay with any retail title. **AI use** - ChatGPT (GPT-6): assisted with code development, troubleshooting, testing analysis and PR description drafting. The contributor is responsible for reviewing and understanding the submitted changes.
DavidM1911 commented 2026-11-25 17:07:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T16:42:11Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7168400150 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2251#issuecomment-7168400150). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T16:42:11Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
github-actions[bot] commented 2026-11-29 07:43:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:49Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252654072 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2251#issuecomment-7252654072). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:43:49Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 07:40:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:40:17Z.


Triage (#1607) – head 4d9dbb6

No open PR adds a geometry-shader fallback for GPUs without mesh shaders. Since this branch's base, main has gained its own two-pass DispatchMesh execution (bind::dispatch_mesh, commit 99b9816), so the new cl_dispatch_mesh / prepare_two_pass_draw path overlaps it. Rebased, the fallback should hook into main's path rather than add a second DispatchMesh override.
Problems in the diff:

  • README.md: "and dxil.dll" became "+ dxil.dll", which starts a Markdown list in the middle of the sentence.
  • pso.rs finish_two_pass_compiled: the fallback VS and GS are compiled for every two-pass pipeline, also on GPUs with mesh shaders. A failed GS compile (?) then fails the mesh path too.
  • Not run: the full suite and a retail title (listed under Not tested).
    Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304339778 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2251#issuecomment-7304339778). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:40:17Z. --- **Triage (#1607)** – head 4d9dbb6 No open PR adds a geometry-shader fallback for GPUs without mesh shaders. Since this branch's base, main has gained its own two-pass `DispatchMesh` execution (`bind::dispatch_mesh`, commit 99b9816), so the new `cl_dispatch_mesh` / `prepare_two_pass_draw` path overlaps it. Rebased, the fallback should hook into main's path rather than add a second `DispatchMesh` override. Problems in the diff: - `README.md`: "and `dxil.dll`" became "+ `dxil.dll`", which starts a Markdown list in the middle of the sentence. - `pso.rs` `finish_two_pass_compiled`: the fallback VS and GS are compiled for every two-pass pipeline, also on GPUs with mesh shaders. A failed GS compile (`?`) then fails the mesh path too. - Not run: the full suite and a retail title (listed under Not tested). Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2251:upstream-pr/2251'
git switch 'upstream-pr/2251'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2251'
git switch 'upstream-pr/2251'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2251'
git switch 'upstream-pr/2251'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2251'
git switch 'main'
git merge --squash 'upstream-pr/2251'
git switch 'main'
git merge --ff-only 'upstream-pr/2251'
git switch 'main'
git merge 'upstream-pr/2251'
git push origin 'main'
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
xcl-dev/xcl!2241
No description provided.