d3d12: a mesh PSO with conservative rasterization needs no topology type (RT-MESH-PSO-CONSERVATIVE-TOPOLOGY) #2097

Manually merged
github merged 1 commit from github-bot/gh-2097 into main 2026-11-26 14:53:20 +00:00 AGit
Owner

@⁠Snooozs on GitHub · 2026-11-25 20:19 UTC · original
Snooozs:mesh-conservative-topology → main · +66 −3 · 5 files · 1 commits · merged 2026-11-26 14:41 UTC

Claimed in the coordination issue as RT-MESH-PSO-CONSERVATIVE-TOPOLOGY: #1608

The finding is Undefined3301's (7173346254): 14 of the 15 CreatePipelineState refusals of a retail boot are mesh PSOs with conservative rasterization on. They could not send a pull request because of the open-PR limit.

Cause

create_graphics requires PrimitiveTopologyType == TRIANGLE for a conservative PSO. A mesh pipeline has no input assembler, its stream need not set the subobject, and the type reads 0.

Change

  • The topology rule applies only to pipelines with an input assembler.
  • A mesh pipeline needs a module that outputs triangles: conservative_raster::mesh_outputs_triangles reads the execution mode from the SPIR-V (OutputTrianglesEXT; lines, points and no mode are refused with E_INVALIDARG, as TRIANGLE was required before).
  • Wireframe is still refused, ForcedSampleCount != 0 still E_NOTIMPL.

Tested

RTX 5060 Ti, NVIDIA 621.01, Windows 10 19045, MSVC, main db1a22d29:

  • conservative_raster (CPU): the new execution-mode cases.
  • d3d12_mesh: a mesh PSO with conservative rasterization on and no topology type is created, a wireframe one and a vertex pipeline without a topology type are E_INVALIDARG. The test's device did not enable VK_EXT_conservative_rasterization before; it does now where the GPU has it (tier 2 here, the test prints it). Without the change to d3d12_vulkan_device.cpp the test fails at the first of these lines, with it it passes. Also run with LEONIDA_VK_VALIDATION=1, no error.
  • d3d12_conservative_raster passes. d3d12_pso_validation fails on this machine with and without this change, at the DYNAMIC_DEPTH_BIAS flag (#967).
  • check_no_game_data.py is clean.

Not shown: that the created Vulkan pipeline draws the right coverage with a mesh shader (the PSO is created, and nothing is drawn with it in this test), and the retail boot. I see 15 such refusals in two boots of mine, but did not check which PSOs they are.

AI-assisted (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

**@⁠Snooozs** on GitHub · 2026-11-25 20:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2097) `Snooozs:mesh-conservative-topology` → `main` · +66 −3 · 5 files · 1 commits · merged 2026-11-26 14:41 UTC Claimed in the coordination issue as RT-MESH-PSO-CONSERVATIVE-TOPOLOGY: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608 **The finding is Undefined3301's** ([7173346254](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608)): 14 of the 15 `CreatePipelineState` refusals of a retail boot are mesh PSOs with conservative rasterization on. They could not send a pull request because of the open-PR limit. ### Cause `create_graphics` requires `PrimitiveTopologyType == TRIANGLE` for a conservative PSO. A mesh pipeline has no input assembler, its stream need not set the subobject, and the type reads 0. ### Change - The topology rule applies only to pipelines with an input assembler. - A mesh pipeline needs a module that outputs triangles: `conservative_raster::mesh_outputs_triangles` reads the execution mode from the SPIR-V (`OutputTrianglesEXT`; lines, points and no mode are refused with `E_INVALIDARG`, as `TRIANGLE` was required before). - Wireframe is still refused, `ForcedSampleCount != 0` still `E_NOTIMPL`. ### Tested RTX 5060 Ti, NVIDIA 621.01, Windows 10 19045, MSVC, main db1a22d29: - `conservative_raster` (CPU): the new execution-mode cases. - `d3d12_mesh`: a mesh PSO with conservative rasterization on and no topology type is created, a wireframe one and a vertex pipeline without a topology type are `E_INVALIDARG`. The test's device did not enable `VK_EXT_conservative_rasterization` before; it does now where the GPU has it (tier 2 here, the test prints it). **Without the change to `d3d12_vulkan_device.cpp` the test fails** at the first of these lines, with it it passes. Also run with `LEONIDA_VK_VALIDATION=1`, no error. - `d3d12_conservative_raster` passes. `d3d12_pso_validation` fails on this machine with and without this change, at the `DYNAMIC_DEPTH_BIAS` flag (#967). - `check_no_game_data.py` is clean. Not shown: that the created Vulkan pipeline draws the right coverage with a mesh shader (the PSO is created, and nothing is drawn with it in this test), and the retail boot. I see 15 such refusals in two boots of mine, but did not check which PSOs they are. AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:17:44 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 05:31 UTC · original · reviewed

Independent native Windows check on b986d274b, GeForce RTX 5070, NVIDIA 610.88: conservative_raster, d3d12_conservative_raster and d3d12_mesh passed. The mesh test exercised the Tier 2 branch.

I also reran the mesh fixture with its DispatchMesh draws bound to the conservative PSO created from the stream without a topology type. Readback matched all 3,720 checked pixels away from quadrant and stripe boundaries. This checks draw and readback through that PSO. The fixture uses synthetic shaders.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 05:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2097#pullrequestreview-6069006174) · **reviewed** Independent native Windows check on `b986d274b`, GeForce RTX 5070, NVIDIA 610.88: `conservative_raster`, `d3d12_conservative_raster` and `d3d12_mesh` passed. The mesh test exercised the Tier 2 branch. I also reran the mesh fixture with its `DispatchMesh` draws bound to the conservative PSO created from the stream without a topology type. Readback matched all 3,720 checked pixels away from quadrant and stripe boundaries. This checks draw and readback through that PSO. The fixture uses synthetic shaders. AI-assisted.
Author
Owner

@⁠Snooozs on GitHub · 2026-11-26 10:27 UTC · original

The red CI jobs here are failures that main has now too, each with an open fix:

  • windows: vk_xdxr_postbuild_readback fails in 0.02 s on the runner (no device with bufferDeviceAddress), fix #1418.
  • linux-gpu-tools build: vk_null_descriptor_test.cpp:97 uses LEONIDA_TEST_NULL_DESCRIPTORS_SPV, which only exists when glslangValidator is found, fix #2055.
  • macos: cs_imgatomic_ext fails on MoltenVK, fix #1518.

Nothing in this PR touches those files. AI-assisted (Claude Code).

**@⁠Snooozs** on GitHub · 2026-11-26 10:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2097#issuecomment-7189391652) The red CI jobs here are failures that `main` has now too, each with an open fix: - `windows`: `vk_xdxr_postbuild_readback` fails in 0.02 s on the runner (no device with bufferDeviceAddress), fix #1418. - `linux-gpu-tools` build: `vk_null_descriptor_test.cpp:97` uses `LEONIDA_TEST_NULL_DESCRIPTORS_SPV`, which only exists when glslangValidator is found, fix #2055. - `macos`: `cs_imgatomic_ext` fails on MoltenVK, fix #1518. Nothing in this PR touches those files. AI-assisted (Claude Code).
github manually merged commit 062623063e into main 2026-11-26 14:53:20 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-26 14:42 UTC · original

Thank you, @⁠Snooozs. This went into main through #2350 (RT-LINUX-AMD-WORLD), merged at your head b986d274b with your commits and authorship kept. GitHub shows this PR as merged for that reason, so nothing needs closing.

AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)

**@⁠aslan2142** on GitHub · 2026-11-26 14:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2097#issuecomment-7195196561) Thank you, @⁠Snooozs. This went into `main` through #2350 (RT-LINUX-AMD-WORLD), merged at your head `b986d274b` with your commits and authorship kept. GitHub shows this PR as merged for that reason, so nothing needs closing. AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
This discussion has been locked. Commenting is limited to contributors.
No description provided.