Repository navigation
d3d12/vulkan: implement hardware depth-bounds testing (D3D-DEPTH-BOUNDS) - #469
jujumoneylol wants to merge 1 commit into
Conversation
…/2 + OMSetDepthBounds)
|
Independent Windows review of b75e451 applied to main 1c93c86. RTX 5070 Ti (610.74), Windows 11 26100.7623, MSVC Release, Vulkan validation 1.4.369. The eight stock cases passed. The following differences reproduced in two runs of an extended synthetic fixture against native D3D12 on the same adapter.
The no-depth-attachment control also rendered identically. The extended run failed its validation check on the inverted range. All fixtures were synthetic. AI-assisted. |
…nd multi-scissor rendering (1..16 viewports/scissors) Resolved against ProjectLeonida#499's emit_graphics_pass, ProjectLeonida#469's depth bounds and ProjectLeonida#511's lazy modules: the viewport/scissor setup moves into emit_graphics_pass, the pipeline's dynamic-state list keeps DEPTH_BOUNDS and picks the *_WITH_COUNT states, and ProjectLeonida#499's ExecuteIndirect draws now carry the bound depth bounds and viewports like record_draw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd depth bounds (ProjectLeonida#469), like record_draw Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Build failure at b75e451 with MSVC on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300), native Windows Built with The build stops in the new test code (two builds, same result): Line 271 is |
|
checked:
Before this PR, the only reason logged near the end was Not run: the synthetic depth-bounds tests on this GPU, #815 (which covers the same ground). AI-assisted (Claude Code). |
|
Thanks for this, and for the host pixel-parity test. We're going with #815 for D3D-DEPTH-BOUNDS, because it is the more correct fix right now:
Your branch has things #815 lacks, and they'd be worth porting as a follow-up on top of #815. You'd be welcome to open it:
AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: D3D-DEPTH-BOUNDS (#14 (comment))
What and why
Implements hardware depth-bounds testing end-to-end in the D3D12 → Vulkan runtime, clearing one of the live frame-loop PSO stream refusals recorded in
docs/retail_boot_intel_host.mdsection 3 (depth-bounds stream subobject):VkPhysicalDeviceFeatures::depthBoundswhere advertised by the GPU increate_vulkan_device_standalone(runtime/shims/d3d12_vulkan_device.cpp) andvktest::Device(runtime/test/vk_test_device.h), exposing it throughVulkanDeviceInfo::features.depthBounds.D3D12_FEATURE_DATA_D3D12_OPTIONS2::DepthBoundsTestSupported = state_.info.features.depthBounds ? TRUE : FALSEinstead of hardcodedFALSE.DEPTH_STENCIL1/DEPTH_STENCIL2):parse_pipeline_streamrecordsDepthBoundsTestEnablefromD3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1andDEPTH_STENCIL2instead of unconditionally returningE_NOTIMPL.PipelineState::create_graphicsenablesVkPipelineDepthStencilStateCreateInfo::depthBoundsTestEnable, refuses withE_NOTIMPLonly whenVulkanDeviceInfo::features.depthBoundsis false, and appendsVK_DYNAMIC_STATE_DEPTH_BOUNDSto the dynamic state list (for both regular and mesh PSOs) when enabled.OMSetDepthBounds→vkCmdSetDepthBounds):ID3D12GraphicsCommandList1::OMSetDepthBounds(Min, Max)inruntime/shims/d3d12_com.cpp(defaults to[0.0f, 1.0f]on create/reset, refused in bundles per D3D12 spec), carries(depth_bounds_min, depth_bounds_max)onleonida::Drawfor both vertex and mesh draws, and replaysvkCmdSetDepthBounds(clamped to[0.0f, 1.0f]/ NaN-safe for Vulkan spec compliance) inruntime/src/vulkan_replay.h.runtime/test/d3d12_depth_bounds_test.cpp(in-memory SPIR-V 1.3 fullscreen VS + solid PS, no external shader compiler needed) verifying feature reporting, feature-offE_NOTIMPLrefusal, bundle refusal, and 8 live GPU draw cases compared pixel-for-pixel against the host Windows D3D12 runtime on the same adapter.d3d12_vulkan_device_test(OPTIONS2.DepthBoundsTestSupportedinvariant + toggle test),d3d12_mesh_test(DepthBoundsTestEnablefollowsvk.enabled.depthBounds), andreplay_cpu_bench.Tested
d3d12_depth_bounds_test,d3d12_vulkan_device_test, andreplay_cpu_benchwith MSVC 19.44 (vcvars64) + Ninja on top ofmain8f481cf16.d3d12_depth_bounds_test: ALL 8 CASES PASSED (EXACT MATCH vs host D3D12) on NVIDIA GeForce GTX 1650 (DepthBoundsTestSupported=TRUE), matching host pixels bit-for-bit across default[0.0, 1.0],[0.25, 0.75]pass,[0.6, 0.9]reject,[0.1, 0.4]reject,[0.5, 0.5]inclusive boundary pass,DEPTH_STENCIL2pass/reject, andReset()restoring[0.0, 1.0], plus feature-offE_NOTIMPLand bundle refusal checks.d3d12_vulkan_device_test: PASSED (including newOPTIONS2.DepthBoundsTestSupportedhost parity and toggle check).py -3.13 -I scripts/check_no_game_data.pyon all 12 touched files: clean.GPUs tested: NVIDIA GeForce GTX 1650 Mobile 4 GB (driver 592.00, Vulkan 1.4.325, Windows 11 26200)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — D3D12 → Vulkan runtime only)