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

Closed
opened 2026-11-26 21:20:02 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2097
Author: @Snooozs
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: mesh-conservative-topology


📝 Commits (1)

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

📊 Changes

5 files changed (+66 additions, -3 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+2 -1)
📝 runtime/shims/d3d12_vulkan_device.cpp (+5 -2)
📝 runtime/src/conservative_raster.h (+17 -0)
📝 runtime/test/conservative_raster_test.cpp (+13 -0)
📝 runtime/test/d3d12_mesh_test.cpp (+29 -0)

📄 Description

Claimed in the coordination issue as RT-MESH-PSO-CONSERVATIVE-TOPOLOGY: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173391300

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2097 **Author:** [@Snooozs](https://github.com/Snooozs) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `mesh-conservative-topology` --- ### 📝 Commits (1) - [`b986d27`](https://github.com/ubiquitarianism/leonida/commit/b986d274bf6443aff485e39d220a7717aa48e56f) d3d12: a mesh PSO with conservative rasterization needs no topology type (RT-MESH-PSO-CONSERVATIVE-TOPOLOGY) ### 📊 Changes **5 files changed** (+66 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+2 -1) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+5 -2) 📝 `runtime/src/conservative_raster.h` (+17 -0) 📝 `runtime/test/conservative_raster_test.cpp` (+13 -0) 📝 `runtime/test/d3d12_mesh_test.cpp` (+29 -0) </details> ### 📄 Description Claimed in the coordination issue as RT-MESH-PSO-CONSERVATIVE-TOPOLOGY: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173391300 **The finding is Undefined3301's** ([7173346254](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:02 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2101
No description provided.