You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With LEONIDA_VK_VALIDATION=1 on main: 7 validation errors in d3d12_clear (depth clear outside [0,1]) and d3d12_mesh (pipeline statistics over a mesh draw) #506
On main@8f481cf16, the d3d12_* suite is green without validation (301 of 303 pass, the two known ones) but trips seven Vulkan validation errors when it is switched on. Both tests report the errors themselves and fail, so ctest -R '^d3d12_' goes 113/117 with LEONIDA_VK_VALIDATION=1:
vkCmdClearDepthStencilImage(): pDepthStencil->depth is 1.500000 (not within the [0.0, 1.0] range) but
VK_EXT_depth_range_unrestricted extension is not enabled. [VUID-VkClearDepthStencilValue-depth-00022]
vkCmdClearAttachments(): pAttachments[0].clearValue.depthStencil.depth is -0.500000 (... same VUID)
the same two again with depth nan
The test is deliberately exercising D3D12's ClearDepthStencilView with 1.5, -0.5 and NaN, which the host accepts. Vulkan only accepts them with VK_EXT_depth_range_unrestricted; the layer does not enable it (no use of it in runtime/), so the Vulkan call is out of spec even though the driver takes it. Enabling the extension where the device offers it, or clamping and documenting the difference, would close it. #307 covers a narrower AMD behaviour (NaN canonicalised to 1.0) and does not cover the range check itself.
d3d12_mesh: pipeline statistics incompatible with mesh draws (3 errors)
vkCmdDrawMeshTasksEXT(): query 1 in VkQueryPool ... with type VK_QUERY_TYPE_PIPELINE_STATISTICS is active,
which is invalid because it was created with pipelineStatistics
(CLIPPING_INVOCATIONS_BIT|CLIPPING_PRIMITIVES_BIT) which is incompatible with mesh shaders.
[VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076]
Queries 1 and 3 of the pool. A D3D12 pipeline-statistics query that includes the clipping counters is legal across a mesh draw; the Vulkan equivalent must not have those bits in the pool when vkCmdDrawMeshTasksEXT runs, so the layer needs to end/switch the query (or drop those bits for mesh pipelines) instead of recording the draw with the query active.
Neither error needs game files; both come from the synthetic tests in runtime/test.
I reproduced the four d3d12_clear validation errors on RTX 5070 Ti. #516 fixes the depth-clear half and passes both extension-enabled and restricted-depth tests with Vulkan validation enabled.
I also reproduced all three mesh errors and verified a separate candidate change on c023a36. With this change and #516 applied together, d3d12_clear, d3d12_clear_restricted_depth and d3d12_mesh passed with validation enabled. The mesh segment contributed pixel and compute invocations. Clipping was counted in regular draw segments. In a native comparison, WARP and hardware D3D12 each reported one clipping invocation and one primitive for one mesh triangle.
I closed my duplicate PR #527 because Mby159 had already claimed D3D-291. The measurements above are available for that work.
Follow-up on the exact #540 head c9f4a56. d3d12_mesh passed with validation enabled on RTX 5070 Ti. With #516 applied over it, all three tests covering this issue passed. Test report
Status check on current main (b4b7756e8, merge of #403), ctest -C RelWithDebInfo -R "d3d12_clear|d3d12_mesh" with LEONIDA_VK_VALIDATION=1. Both halves of this issue have merged fixes: #516 (depth clear range, merge 3f203947) and #540 (mesh statistics pool drops the clipping counters, merge 3bb46d65), plus #577's mesh-primitives clipping counter (47c651174).
NVIDIA GeForce RTX 4070 SUPER (VK_LOADER_DRIVERS_SELECT=*nv-vk* LEONIDA_VK_DEVICE=4070): all four matched tests pass with validation on — d3d12_clear, d3d12_clear_restricted_depth, d3d12_mesh, d3d12_clear_formats. The tests fail on any reported validation error, so none of the 7 original VUIDs (VkClearDepthStencilValue-depth-00022 x4, vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 x3) reproduce.
AMD Radeon iGPU (VK_LOADER_DRIVERS_SELECT=*amd-vulkan* LEONIDA_VK_DEVICE=radeon LEONIDA_PC_TAIL_UBO=1): d3d12_clear_restricted_depth and d3d12_clear_formats pass; d3d12_clear fails only on the known AMD NaN→1.0 canonicalization quirk (#787/#307 — 15 NaN texels read back 1.0) with nodepth-00022 VUID; d3d12_mesh fails before any draw because the test shaders need 144 bytes of push constants and the device reports maxPushConstantsSize 128 (the known 128B pushconst limit) — the mesh-draw statistics path can't be exercised on this iGPU, but no validation errors were emitted up to that point.
Verdict: fixed on NVIDIA; the depth-clear half is fixed on AMD too (the remaining d3d12_clear failure there is the separate #787 quirk, not this issue). The mesh half is verified on NVIDIA only — the AMD iGPU cannot run d3d12_mesh due to the push-constant limit, so it stays unverifiable on that device until #1449-class work lands.
Environment note for whoever runs this next: the tests need TMP/TEMP/TMPDIR and COMSPEC set — under a stripped agent shell std::filesystem::temp_directory_path() resolves to C:\Windows, create_directories fails, and the test dies with 0xc0000409 before printing anything (looks like a crash, isn't one).
pipeline statistics over a mesh draw in d3d12_mesh: d3d12/vulkan: the mesh statistics pool enables no forbidden counter (D3D-291) #540 (916dbc6, D3D-291, "the mesh statistics pool enables no forbidden counter")
Could you rerun d3d12_clear and d3d12_mesh with LEONIDA_VK_VALIDATION=1 on current main? If both come out clean, this can be closed. (I could not run them: they are Windows-only.)
Retested the two requested cases on native Windows 11 build 26100, MSVC 19.44 RelWithDebInfo, at main bcaa13dad. Each run selected its adapter explicitly. Both tests reported validation on and the Vulkan loader confirmed the Khronos 1.4.369 layer was active.
Fail: the mixed mesh/vertex statistics assertion at d3d12_mesh_test.cpp:688
0
Neither originally reported VUID reproduced on either GPU. On this iGPU the mesh test reached the mixed-query readback. A second run failed at the same assertion, again with no VUID. The assertion checks several counters together, so this run does not identify which counter differed.
Verified on current main0d80bc5df, with the Khronos validation layer actually active.
Environment:
Windows 11 Pro build 26300
NVIDIA GeForce RTX 3080 Ti, driver 616.64
Vulkan SDK 1.4.363.0 (VK_LAYER_KHRONOS_validation, "Khronos Validation Layer", api 1.4.363), installed via winget. d3d12_mesh_test needs glslangValidator, so it was built for this run.
These tests fail on any reported validation error, so none of the seven original VUIDs (VkClearDepthStencilValue-depth-00022 x4, vkCmdDrawMeshTasksEXT-pipelineStatistics-07076 x3) reproduce here. The depth-clear half (#516) and the mesh-statistics half (#540/#577) are on main.
Note this run covers the original Windows/NVIDIA validation VUIDs only; the separate AMD failures (e.g. NaN depth canonicalization) are a different problem and are not exercised here. On this evidence the issue looks closeable.
The seven original VUIDs no longer reproduce on current main (verified on 0d80bc5 with the Khronos validation layer, above), and #516/#540/#577 are merged. This can be closed; the separate AMD NaN-depth failures are a different problem. (AI-assisted.)
Both validation errors have merged fixes on main: the depth clear outside [0, 1] by 673dd15d0 (D3D-CLEAR-DEPTH-RANGE, merged in #516) and the mesh pipeline-statistics case by #540 (3bb46d658). Both are ancestors of origin/main at 9e7720c9e. A rerun with LEONIDA_VK_VALIDATION=1 should show 0 in d3d12_clear; anything left would be new.
The seven reported Vulkan validation errors are resolved on current main: depth clear range in #516 and the mesh statistics pool/counter handling in #540/#577. Follow-up runs with the Khronos validation layer active report all original VUIDs absent. Remaining AMD NaN-depth and push-constant-limit failures are separate issues, so closing this report.
Checked the current source and follow-up reports: the original seven VUIDs are fixed on main by #516 (depth clear) and #540/#577 (mesh statistics). Runs with Khronos validation active report none of those VUIDs. The AMD NaN-depth and mesh push-constant-limit failures mentioned in later reports are separate. I attempted to close this resolved report, but GitHub denied the account the CloseIssue permission, so it remains open for a maintainer to close.
Activity
sodove commentedon Nov 24, 2026
I reproduced the four d3d12_clear validation errors on RTX 5070 Ti. #516 fixes the depth-clear half and passes both extension-enabled and restricted-depth tests with Vulkan validation enabled.
I also reproduced all three mesh errors and verified a separate candidate change on c023a36. With this change and #516 applied together, d3d12_clear, d3d12_clear_restricted_depth and d3d12_mesh passed with validation enabled. The mesh segment contributed pixel and compute invocations. Clipping was counted in regular draw segments. In a native comparison, WARP and hardware D3D12 each reported one clipping invocation and one primitive for one mesh triangle.
I closed my duplicate PR #527 because Mby159 had already claimed D3D-291. The measurements above are available for that work.
Follow-up on the exact #540 head c9f4a56. d3d12_mesh passed with validation enabled on RTX 5070 Ti. With #516 applied over it, all three tests covering this issue passed. Test report
Merge pull request #540 from Mby159/d3d-291-mesh-statistics
whoalin1 commentedon Nov 25, 2026
Status check on current
main(b4b7756e8, merge of #403),ctest -C RelWithDebInfo -R "d3d12_clear|d3d12_mesh"withLEONIDA_VK_VALIDATION=1. Both halves of this issue have merged fixes: #516 (depth clear range, merge3f203947) and #540 (mesh statistics pool drops the clipping counters, merge3bb46d65), plus #577's mesh-primitives clipping counter (47c651174).NVIDIA GeForce RTX 4070 SUPER (
VK_LOADER_DRIVERS_SELECT=*nv-vk* LEONIDA_VK_DEVICE=4070): all four matched tests pass with validation on —d3d12_clear,d3d12_clear_restricted_depth,d3d12_mesh,d3d12_clear_formats. The tests fail on any reported validation error, so none of the 7 original VUIDs (VkClearDepthStencilValue-depth-00022x4,vkCmdDrawMeshTasksEXT-pipelineStatistics-07076x3) reproduce.AMD Radeon iGPU (
VK_LOADER_DRIVERS_SELECT=*amd-vulkan* LEONIDA_VK_DEVICE=radeon LEONIDA_PC_TAIL_UBO=1):d3d12_clear_restricted_depthandd3d12_clear_formatspass;d3d12_clearfails only on the known AMD NaN→1.0 canonicalization quirk (#787/#307 — 15 NaN texels read back 1.0) with nodepth-00022VUID;d3d12_meshfails before any draw because the test shaders need 144 bytes of push constants and the device reportsmaxPushConstantsSize 128(the known 128B pushconst limit) — the mesh-draw statistics path can't be exercised on this iGPU, but no validation errors were emitted up to that point.Verdict: fixed on NVIDIA; the depth-clear half is fixed on AMD too (the remaining
d3d12_clearfailure there is the separate #787 quirk, not this issue). The mesh half is verified on NVIDIA only — the AMD iGPU cannot rund3d12_meshdue to the push-constant limit, so it stays unverifiable on that device until #1449-class work lands.Environment note for whoever runs this next: the tests need
TMP/TEMP/TMPDIRandCOMSPECset — under a stripped agent shellstd::filesystem::temp_directory_path()resolves toC:\Windows,create_directoriesfails, and the test dies with0xc0000409before printing anything (looks like a crash, isn't one).AI-assisted: yes (Devin).
efeekrb commentedon Nov 25, 2026
Both causes reported here have fixes merged on main since this was opened:
Could you rerun d3d12_clear and d3d12_mesh with LEONIDA_VK_VALIDATION=1 on current main? If both come out clean, this can be closed. (I could not run them: they are Windows-only.)
sodove commentedon Nov 25, 2026
Retested the two requested cases on native Windows 11 build 26100, MSVC 19.44 RelWithDebInfo, at main
bcaa13dad. Each run selected its adapter explicitly. Both tests reported validation on and the Vulkan loader confirmed the Khronos 1.4.369 layer was active.d3d12_cleard3d12_meshLEONIDA_PC_TAIL_UBO=1d3d12_mesh_test.cpp:688Neither originally reported VUID reproduced on either GPU. On this iGPU the mesh test reached the mixed-query readback. A second run failed at the same assertion, again with no VUID. The assertion checks several counters together, so this run does not identify which counter differed.
Synthetic fixtures only. AI-assisted: yes (OpenAI Codex).
BubsMcgee commentedon Nov 25, 2026
Verified on current
main0d80bc5df, with the Khronos validation layer actually active.Environment:
VK_LAYER_KHRONOS_validation, "Khronos Validation Layer", api 1.4.363), installed via winget.d3d12_mesh_testneedsglslangValidator, so it was built for this run.Command:
Result: 4/4 passed, 0 failed
d3d12_cleard3d12_clear_restricted_depthd3d12_meshd3d12_clear_formatsThese tests fail on any reported validation error, so none of the seven original VUIDs (
VkClearDepthStencilValue-depth-00022x4,vkCmdDrawMeshTasksEXT-pipelineStatistics-07076x3) reproduce here. The depth-clear half (#516) and the mesh-statistics half (#540/#577) are on main.Note this run covers the original Windows/NVIDIA validation VUIDs only; the separate AMD failures (e.g. NaN depth canonicalization) are a different problem and are not exercised here. On this evidence the issue looks closeable.
AI-assisted.
BubsMcgee commentedon Nov 25, 2026
The seven original VUIDs no longer reproduce on current main (verified on 0d80bc5 with the Khronos validation layer, above), and #516/#540/#577 are merged. This can be closed; the separate AMD NaN-depth failures are a different problem. (AI-assisted.)
BubsMcgee commentedon Nov 25, 2026
Both validation errors have merged fixes on main: the depth clear outside [0, 1] by
673dd15d0(D3D-CLEAR-DEPTH-RANGE, merged in #516) and the mesh pipeline-statistics case by #540 (3bb46d658). Both are ancestors oforigin/mainat9e7720c9e. A rerun withLEONIDA_VK_VALIDATION=1should show 0 ind3d12_clear; anything left would be new.ZroIsHere commentedon Nov 26, 2026
The seven reported Vulkan validation errors are resolved on current main: depth clear range in #516 and the mesh statistics pool/counter handling in #540/#577. Follow-up runs with the Khronos validation layer active report all original VUIDs absent. Remaining AMD NaN-depth and push-constant-limit failures are separate issues, so closing this report.
ZroIsHere commentedon Nov 26, 2026
Checked the current source and follow-up reports: the original seven VUIDs are fixed on main by #516 (depth clear) and #540/#577 (mesh statistics). Runs with Khronos validation active report none of those VUIDs. The AMD NaN-depth and mesh push-constant-limit failures mentioned in later reports are separate. I attempted to close this resolved report, but GitHub denied the account the
CloseIssuepermission, so it remains open for a maintainer to close.