GPU: say which part of a refused mesh pipeline the driver refuses #436

Open
github-bot wants to merge 1 commit from github-bot/gh-436 into main AGit
Owner

@⁠sennecools on GitHub · 2026-11-25 00:49 UTC · original
sennecools:contrib/mesh-refusal-reason → main · +162 −12 · 1 files · 1 commits · open

Without the debug layer the driver refuses a mesh pipeline with only E_INVALIDARG, which says nothing about the cause.

When a mesh pipeline is refused, it is now made again, outside the pipeline library, with one part of its description after another made neutral:

  1. the blend state and sample mask;
  2. the rasterizer state;
  3. the depth and stencil state (depth off);
  4. the target formats, depth format and sample count;
  5. without its pixel shader.

Each step keeps the earlier ones. The "host mesh pipeline refused" warning names the first part whose neutral form the driver accepts, and also gives the root parameter and static sampler counts and the state text. Only refused pipelines pay for the extra attempts; nothing changes for pipelines that are accepted.

Testing:

  • new test a_refused_mesh_pipeline_names_the_part_refused: breaks each part on purpose and checks the name, and checks a pixel shader that reads an input the mesh shader does not write. It skips without mesh shader support or without the PC dxc.exe, like the library test;
  • cargo test -p victory-gpu --features victory-gpu/diagnostics on WARP: 120 passed (the mesh tests ran);
  • clippy -D warnings clean, asset policy ok;
  • not tried in a game run: this change only adds diagnostics.

AI-assisted.

**@⁠sennecools** on GitHub · 2026-11-25 00:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/436) `sennecools:contrib/mesh-refusal-reason` → `main` · +162 −12 · 1 files · 1 commits · open Without the debug layer the driver refuses a mesh pipeline with only E_INVALIDARG, which says nothing about the cause. When a mesh pipeline is refused, it is now made again, outside the pipeline library, with one part of its description after another made neutral: 1. the blend state and sample mask; 2. the rasterizer state; 3. the depth and stencil state (depth off); 4. the target formats, depth format and sample count; 5. without its pixel shader. Each step keeps the earlier ones. The "host mesh pipeline refused" warning names the first part whose neutral form the driver accepts, and also gives the root parameter and static sampler counts and the state text. Only refused pipelines pay for the extra attempts; nothing changes for pipelines that are accepted. Testing: - new test `a_refused_mesh_pipeline_names_the_part_refused`: breaks each part on purpose and checks the name, and checks a pixel shader that reads an input the mesh shader does not write. It skips without mesh shader support or without the PC dxc.exe, like the library test; - `cargo test -p victory-gpu --features victory-gpu/diagnostics` on WARP: 120 passed (the mesh tests ran); - clippy -D warnings clean, asset policy ok; - not tried in a game run: this change only adds diagnostics. AI-assisted.
Without the debug layer the driver refuses a mesh pipeline with only
E_INVALIDARG. On refusal the pipeline is now made again, outside the
library, with the blend state, the rasterizer state, the depth and
stencil state, then the targets, depth format and sample count made
neutral one after another, then without its pixel shader; the warning
names the first part whose neutral form is accepted, with the root
parameter and static sampler counts and the state text. Only refused
pipelines pay for the extra attempts. The new test skips on a host
without mesh shaders, as the library test does.

AI-assisted (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:43:16 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:49 UTC · original · edited 2026-11-25 00:53 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T00:53:00.252282Z 0f1d56b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 00:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/436#issuecomment-7148916471) · edited 2026-11-25 00:53 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"0f1d56b6eb982dc10ec3d695ea8f4ca15ff3a2f2","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-25T00:53:00.252282Z">2026-11-25T00:53:00.252282Z</relative-time> | `0f1d56b` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
@ -788,0 +851,4 @@
}
s.targets = D3D12_RT_FORMAT_ARRAY::default();
s.targets.NumRenderTargets = 1;
s.targets.RTFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:52 UTC · original

P2 Badge Match neutral target formats to the pixel-output types

For a pipeline with a valid uint pixel output and R32_UINT RTV that is refused because samples.Count == 0, this probe fixes the sample count but introduces a new PS-output/RTV type mismatch by replacing the RTV with UNORM. That attempt still fails, while removing the otherwise-valid PS succeeds, so the warning incorrectly identifies the pixel shader/linkage instead of the sample-count/format state. Select neutral RTV formats compatible with the PS output signature, as target_format in crates/victory-shader/src/emit/host.rs does, and extend the sample-count test case to cover an integer-output PS.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-25 00:52 UTC · [original](https://github.com/fxceless/victory-fork/pull/436#discussion_r4688698508) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Match neutral target formats to the pixel-output types** For a pipeline with a valid `uint` pixel output and `R32_UINT` RTV that is refused because `samples.Count == 0`, this probe fixes the sample count but introduces a new PS-output/RTV type mismatch by replacing the RTV with UNORM. That attempt still fails, while removing the otherwise-valid PS succeeds, so the warning incorrectly identifies the pixel shader/linkage instead of the sample-count/format state. Select neutral RTV formats compatible with the PS output signature, as `target_format` in `crates/victory-shader/src/emit/host.rs` does, and extend the sample-count test case to cover an integer-output PS. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -788,0 +851,4 @@
}
s.targets = D3D12_RT_FORMAT_ARRAY::default();
s.targets.NumRenderTargets = 1;
s.targets.RTFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
Author
Owner

@⁠sennecools on GitHub · 2026-11-25 02:05 UTC · original

Thanks for the review. I checked this: D3D12 does not refuse a pipeline whose pixel output type differs from the render target type (the result is undefined values, not an invalid pipeline). A pixel shader with an integer output and the neutral UNORM target is accepted (checked on WARP), so a pipeline refused only for its sample count is still reported as the target formats, depth format or sample count. No change needed.

AI-assisted.

**@⁠sennecools** on GitHub · 2026-11-25 02:05 UTC · [original](https://github.com/fxceless/victory-fork/pull/436#discussion_r4689276278) Thanks for the review. I checked this: D3D12 does not refuse a pipeline whose pixel output type differs from the render target type (the result is undefined values, not an invalid pipeline). A pixel shader with an integer output and the neutral UNORM target is accepted (checked on WARP), so a pipeline refused only for its sample count is still reported as the target formats, depth format or sample count. No change needed. AI-assisted.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/436/head:github-bot/gh-436'
git switch 'github-bot/gh-436'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-436'
git switch 'github-bot/gh-436'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-436'
git switch 'github-bot/gh-436'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-436'
git switch 'main'
git merge --squash 'github-bot/gh-436'
git switch 'main'
git merge --ff-only 'github-bot/gh-436'
git switch 'main'
git merge 'github-bot/gh-436'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.