mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #516] [MERGED] d3d12: use legal Vulkan depth clear values (D3D-CLEAR-DEPTH-RANGE) #564
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#564
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/516
Author: @sodove
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:fix/d3d12-clear-depth-range📝 Commits (2)
673dd15d3d12: use legal Vulkan depth clear values (D3D-CLEAR-DEPTH-RANGE)86b069fdocs: record observed D3D12 depth clear semantics📊 Changes
8 files changed (+57 additions, -21 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+5 -0)📝
runtime/CMakeLists.txt(+2 -1)📝
runtime/shims/d3d12_com.h(+1 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+3 -0)📝
runtime/src/vulkan_backend.h(+5 -0)📝
runtime/src/vulkan_replay.h(+8 -4)📝
runtime/test/d3d12_clear_test.cpp(+26 -16)📝
runtime/test/vk_test_device.h(+7 -0)📄 Description
Claimed in the coordination issue as: D3D-CLEAR-DEPTH-RANGE (#14)
What and why
This addresses the depth-clear half of #506. Both full and rectangle clears currently pass unrestricted float depth values to Vulkan on devices that did not enable VK_EXT_depth_range_unrestricted, triggering VUID-VkClearDepthStencilValue-depth-00022.
Enable the extension on standalone devices that advertise it and carry the enabled capability through caller-owned device info to replay. With the extension, float depth clears can preserve the requested value. Without it, replay clamps depth to [0, 1] and uses 0 for NaN. The existing D16 and emulated D24 conversions still apply. The new restricted-depth CTest covers a device created without the extension even on hardware that supports it.
The edge-value test overlaps with #307, which addresses AMD drivers that canonicalize NaN. The mesh query issue in #506 is separate.
Tested
Windows 11 26100.7623, MSVC 19.44.35220 Release, Vulkan validation layer 1.4.369 with LEONIDA_VK_VALIDATION=1.
c023a365, d3d12_clear reports four instances of the VUID. With the fix, it passes with no validation errors, with 232 full and rectangle readbacks matching WARP and the float edge cases matching bit for bit.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Windows 11.
AI-assisted: yes (OpenAI Codex).
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.