[PR #2234] d3d12: the on-demand stream carries the depth-bounds flag too (DEPTH-BOUNDS-ON-DEMAND-STREAM) #2238

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2234
Author: @star41905453-coder
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: depth-bounds-stream


📝 Commits (2)

  • 7e21a88 d3d12: support hardware depth-bounds testing and OMSetDepthBounds
  • a6e66c7 d3d12: the on-demand stream carries the depth-bounds flag too (DEPTH-BOUNDS-ON-DEMAND-STREAM)

📊 Changes

13 files changed (+250 additions, -19 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+7 -2)
📝 runtime/shims/d3d12_com.cpp (+32 -2)
📝 runtime/shims/d3d12_com.h (+3 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+23 -11)
📝 runtime/src/command_list.h (+2 -0)
📝 runtime/src/vulkan_backend.h (+2 -1)
📝 runtime/src/vulkan_replay.h (+10 -0)
📝 runtime/test/d3d12_bundle_forbidden_test.cpp (+3 -0)
📝 runtime/test/d3d12_close_parity_test.cpp (+35 -0)
📝 runtime/test/d3d12_com_test.cpp (+16 -1)
📝 runtime/test/d3d12_mesh_test.cpp (+114 -1)
📝 runtime/test/d3d12_vulkan_device_test.cpp (+2 -1)
📝 runtime/test/vk_test_device.h (+1 -0)

📄 Description

Depends on: #815

A stream that is realized on demand (PipelineState::set_pending_stream, resolved on first use) goes through a second create_graphics call site that passes neither the extras nor the back-face stencil masks. So a title that binds a console PSO before it is realized silently loses DepthBoundsTestEnable — the depth-bounds test is then always on and clips nothing, with no refusal and no log.

This passes both at that call site, the same as the eager one.

Test (d3d12_mesh_test): a stream PSO with DEPTH_STENCIL1 DepthBoundsTestEnable.

  • Where the device has depthBounds: draw the full-screen triangle with bounds 0.9..1.0 and then 0.0..1.0. Outside the bounds nothing may be painted, inside the whole viewport must be. Dropped flag -> yellow outside the bounds.
  • Where it has not (llvmpipe here, depthBounds = false): the flag is refused with E_NOTIMPL — at creation, or at first use on a device that prepares PSOs on demand — and a success would mean the flag was dropped.

What is not proven here: this box has no depthBounds, so the draw half skips. LEONIDA_PIPELINE_COMPILE=on-demand does reach the lazy path, but d3d12_mesh_test already stops at its console-PSO step under that switch on unmodified main (line 344, SUCCEEDED(console_hr)), so the lazy call site is not exercised end to end locally either way. A run on a depth-bounds-capable GPU — under on-demand if possible — proves it; that is where review would help.

Run: d3d12_mesh_test passes here (the capable branch skips), and the whole mesh suite keeps its 9 invalid / 2 not-implemented refusals.

Item: DEPTH-BOUNDS-ON-DEMAND-STREAM, claimed in #1608.


🔄 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/2234 **Author:** [@star41905453-coder](https://github.com/star41905453-coder) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `depth-bounds-stream` --- ### 📝 Commits (2) - [`7e21a88`](https://github.com/ubiquitarianism/leonida/commit/7e21a885ca6028cd3372b7ffc7be0330326b4749) d3d12: support hardware depth-bounds testing and OMSetDepthBounds - [`a6e66c7`](https://github.com/ubiquitarianism/leonida/commit/a6e66c76c346624763f68d8fdc2dbde2adbddba6) d3d12: the on-demand stream carries the depth-bounds flag too (DEPTH-BOUNDS-ON-DEMAND-STREAM) ### 📊 Changes **13 files changed** (+250 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+7 -2) 📝 `runtime/shims/d3d12_com.cpp` (+32 -2) 📝 `runtime/shims/d3d12_com.h` (+3 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+23 -11) 📝 `runtime/src/command_list.h` (+2 -0) 📝 `runtime/src/vulkan_backend.h` (+2 -1) 📝 `runtime/src/vulkan_replay.h` (+10 -0) 📝 `runtime/test/d3d12_bundle_forbidden_test.cpp` (+3 -0) 📝 `runtime/test/d3d12_close_parity_test.cpp` (+35 -0) 📝 `runtime/test/d3d12_com_test.cpp` (+16 -1) 📝 `runtime/test/d3d12_mesh_test.cpp` (+114 -1) 📝 `runtime/test/d3d12_vulkan_device_test.cpp` (+2 -1) 📝 `runtime/test/vk_test_device.h` (+1 -0) </details> ### 📄 Description Depends on: #815 A stream that is realized on demand (`PipelineState::set_pending_stream`, resolved on first use) goes through a second `create_graphics` call site that passes neither the extras nor the back-face stencil masks. So a title that binds a console PSO before it is realized silently loses `DepthBoundsTestEnable` — the depth-bounds test is then always on and clips nothing, with no refusal and no log. This passes both at that call site, the same as the eager one. **Test** (`d3d12_mesh_test`): a stream PSO with `DEPTH_STENCIL1` `DepthBoundsTestEnable`. - Where the device has `depthBounds`: draw the full-screen triangle with bounds 0.9..1.0 and then 0.0..1.0. Outside the bounds nothing may be painted, inside the whole viewport must be. Dropped flag -> yellow outside the bounds. - Where it has not (llvmpipe here, `depthBounds = false`): the flag is refused with `E_NOTIMPL` — at creation, or at first use on a device that prepares PSOs on demand — and a success would mean the flag was dropped. **What is not proven here**: this box has no `depthBounds`, so the draw half skips. `LEONIDA_PIPELINE_COMPILE=on-demand` does reach the lazy path, but `d3d12_mesh_test` already stops at its console-PSO step under that switch on unmodified `main` (line 344, `SUCCEEDED(console_hr)`), so the lazy call site is not exercised end to end locally either way. A run on a depth-bounds-capable GPU — under `on-demand` if possible — proves it; that is where review would help. **Run**: `d3d12_mesh_test` passes here (the capable branch skips), and the whole mesh suite keeps its 9 invalid / 2 not-implemented refusals. Item: DEPTH-BOUNDS-ON-DEMAND-STREAM, claimed in #1608. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2238
No description provided.