[PR #527] [CLOSED] d3d12: keep mesh statistics queries Vulkan-valid (D3D-MESH-STATISTICS-QUERY) #573

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/527
Author: @sodove
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: fix/mesh-statistics-vulkan-queries


📝 Commits (1)

  • b9425ad d3d12: keep mesh statistics queries Vulkan-valid (D3D-MESH-STATISTICS-QUERY)

📊 Changes

5 files changed (+62 additions, -71 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+11 -14)
📝 runtime/src/statistics_sum.comp (+3 -4)
📝 runtime/src/statistics_sum_spirv.h (+33 -37)
📝 runtime/src/vulkan_backend.h (+6 -8)
📝 runtime/test/d3d12_mesh_test.cpp (+9 -8)

📄 Description

Claimed in the coordination issue as: D3D-MESH-STATISTICS-QUERY (#14)

What and why

This addresses the mesh-statistics half of #506. The existing mesh pool enables both clipping counters, which are prohibited during vkCmdDrawMeshTasksEXT. Main produces three validation errors in the synthetic mesh test. Vulkan VUID 07076

The mesh pool now contains fragment and compute invocations. Its two packed counters go to slots 7 and 8, and the existing sum writes the PS and CS fields. Ordinary draw segments still supply all eleven counters. The mesh portion of the clipping fields is zero. This is a measured D3D12 difference: one synthetic triangle produced one clipping invocation and one clipping primitive in both WARP and native D3D12 on this host.

Tested

Windows 11 26100.7623, MSVC 19.44.35220 Release, Khronos validation layer 1.4.369.

  • d3d12_mesh on main c023a365 reports three VUID errors. This branch reports zero and matches all 4096 rendered pixels. Mixed and vertex-only clipping are both 2/2, and mesh-only clipping is 0/0. The mesh-only query still records pixel-shader invocations.
  • d3d12_query_rules, replay_query_predication, and replay_query_edges also pass with LEONIDA_VK_VALIDATION=1.
  • Regenerated the embedded statistics sum from its repository GLSL source with glslang 16.6.0 and SPIR-V validation.

GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11.

AI-assisted: yes (OpenAI Codex).

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption. All fixtures and the internal sum shader are synthetic.
  • New translator rule (not applicable).

🔄 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/527 **Author:** [@sodove](https://github.com/sodove) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mesh-statistics-vulkan-queries` --- ### 📝 Commits (1) - [`b9425ad`](https://github.com/ubiquitarianism/leonida/commit/b9425ad54cd9b1fc0eccebd51a4da543b18f41ed) d3d12: keep mesh statistics queries Vulkan-valid (D3D-MESH-STATISTICS-QUERY) ### 📊 Changes **5 files changed** (+62 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+11 -14) 📝 `runtime/src/statistics_sum.comp` (+3 -4) 📝 `runtime/src/statistics_sum_spirv.h` (+33 -37) 📝 `runtime/src/vulkan_backend.h` (+6 -8) 📝 `runtime/test/d3d12_mesh_test.cpp` (+9 -8) </details> ### 📄 Description Claimed in the coordination issue as: D3D-MESH-STATISTICS-QUERY ([#14](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7124372041)) ### What and why This addresses the mesh-statistics half of #506. The existing mesh pool enables both clipping counters, which are prohibited during vkCmdDrawMeshTasksEXT. Main produces three validation errors in the synthetic mesh test. [Vulkan VUID 07076](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdDrawMeshTasksEXT.html#VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076) The mesh pool now contains fragment and compute invocations. Its two packed counters go to slots 7 and 8, and the existing sum writes the PS and CS fields. Ordinary draw segments still supply all eleven counters. The mesh portion of the clipping fields is zero. This is a measured D3D12 difference: one synthetic triangle produced one clipping invocation and one clipping primitive in both WARP and native D3D12 on this host. ### Tested Windows 11 26100.7623, MSVC 19.44.35220 Release, Khronos validation layer 1.4.369. - d3d12_mesh on main c023a365 reports three VUID errors. This branch reports zero and matches all 4096 rendered pixels. Mixed and vertex-only clipping are both 2/2, and mesh-only clipping is 0/0. The mesh-only query still records pixel-shader invocations. - d3d12_query_rules, replay_query_predication, and replay_query_edges also pass with LEONIDA_VK_VALIDATION=1. - Regenerated the embedded statistics sum from its repository GLSL source with glslang 16.6.0 and SPIR-V validation. GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11. AI-assisted: yes (OpenAI Codex). ### Checklist - [x] Based on current main. - [x] One topic. - [x] No game data, keys or decryption. All fixtures and the internal sum shader are synthetic. - [ ] New translator rule (not applicable). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:20 +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#573
No description provided.