mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #1695] d3d12: realize console streams with their depth-bounds flag and back-face stencil masks (RT-DEPTHBOUNDS-STREAM-EXTRAS) #1709
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#1709
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/1695
Author: @thiefyzheng
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/depthbounds-stream-extras📝 Commits (3)
a635392d3d12: support hardware depth-bounds testing and OMSetDepthBounds6b7bf49d3d12: realize console streams with their depth-bounds flag and back-face stencil masksbb8e113d3d12: hash console stream extras into the pipeline key (single KeyBuilder) and map NaN depth bounds to 0📊 Changes
13 files changed (+259 additions, -21 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(+37 -13)📝
runtime/src/command_list.h(+2 -0)📝
runtime/src/vulkan_backend.h(+2 -1)📝
runtime/src/vulkan_replay.h(+11 -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(+108 -1)📝
runtime/test/d3d12_vulkan_device_test.cpp(+2 -1)📝
runtime/test/vk_test_device.h(+1 -0)📄 Description
RT-DEPTHBOUNDS-STREAM-EXTRAS — Depends on: #815
Claimed on #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156944266). This fixes @djrolfes' integration finding on #815 (https://github.com/ubiquitarianism/leonida/pull/815#issuecomment-7156015786). @kotekompotek: happy to have this folded into #815 instead of a stacked PR — say so and I'll drop it.
Note: the diff includes #815's commit until it merges, since this branches from its head
efea97331.What
PipelineState::resolve_type'sstd::call_onceblock (runtime/shims/d3d12_vulkan_device.cpp:7059) realized a console stream withcreate_graphics(stream.graphics, &stream.ms, &stream.as), silently droppingstream.extras(the depth-bounds flag, #815'sGraphicsStreamExtras) andstream.back_stencil(DEPTH_STENCIL2 back-face masks, whichparse_pipeline_streamfills right next to the front ones). The eagerCreatePipelineStatebranch passes both. It now passesstream.back_masks?&stream.back_stencil:nullptrand&stream.extras— argument-for-argument identical to the eager call at ~12104.prepare_console_stream(~10367) set the pipeline cache key frompipeline_key(stream.graphics)alone; the plainD3D12_DEPTH_STENCIL_DESCthe key hashes cannot see the depth-bounds flag or back-face masks, so two console PSOs differing only in those would collide. The key now post-mixesback_masks,back_stencil.read/.writeandextras.depth_bounds_testwith the samecached_pso::KeyBuilder/sha256_hexidiompipeline_keyitself uses.runtime/test/d3d12_mesh_test.cpp: a console stream (device slot 86, mesh-shader subobject 24) carrying DEPTH_STENCIL1 withDepthBoundsTestEnableand a D32_FLOAT DSV, drawn once insideOMSetDepthBounds(0, 1)(red — depth 0 is inside) and once insideOMSetDepthBounds(0.5, 1)(blue — the discard only happens if the flag reached the pipeline). Without the source fix both draws come out red.What was run
create_graphicssignature match (7119–7123), thePipelineStreamfields and their parse fill, every identifier the test uses in scope with types lined up, fence values (the newbounds_fencepre-increments from 3, first Signal is 4 — no collision with the earlier Signals 1–3), the readback footprint/offset parity with the file's existing usage, slot 86 = consoleCreatePipelineState, and subobject 24 = the console mesh shader (consistent with the existing stream test at line 341 and the console→PC remap ind3d12_xs_pso_stream.h:31). That review caught two real defects, both fixed here: the test's second-frame depth barrier indicated a COMMON→DEPTH_WRITE transition from a buffer already in DEPTH_WRITE (now conditional onfirst_frame), and the cache-key collision above.d3d12_mesh_testwith the one-line source change reverted and show the bounds case fails) needs a depth-bounds-capable Vulkan device, which the author host does not have. The test skips cleanly whenDepthBoundsTestSupportedis FALSE or inpc_onlybuilds.Attribution
AI-assisted: implementation (Claude Sonnet 5.5 worker), independent review and follow-up fixes (GLM 5.3 Flash worker), orchestration and verification by the contributor. No game files were used or are needed; no game data in this PR.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.