mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1377] d3d12: GCL9 RSSetDepthBias and IASetIndexBufferStripCutValue, the DYNAMIC_* PSO flags #1407
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#1407
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/1377
Author: @robot00f
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/d3d12-gcl9-dynamic-state📝 Commits (3)
dd04e55d3d12: GCL9 RSSetDepthBias and IASetIndexBufferStripCutValue, the DYNAMIC_* PSO flags4f21de6d3d12_pso_validation_test: compare the DYNAMIC_* PSO flags with the host only where it reports them6ba1252d3d12_pso_validation_test: the layer answers both dynamic-state features📊 Changes
12 files changed (+341 additions, -54 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+15 -5)📝
runtime/CMakeLists.txt(+1 -1)📝
runtime/shims/d3d12_com.cpp(+72 -5)📝
runtime/shims/d3d12_com.h(+16 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+50 -9)📝
runtime/src/command_list.h(+6 -0)📝
runtime/src/vulkan_backend.h(+5 -3)📝
runtime/src/vulkan_replay.h(+19 -3)📝
runtime/test/d3d12_depth24_draw_test.cpp(+42 -5)📝
runtime/test/d3d12_draw_test.cpp(+26 -6)📝
runtime/test/d3d12_gcl8_test.cpp(+34 -6)📝
runtime/test/d3d12_pso_validation_test.cpp(+55 -11)📄 Description
Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146203524 (ID
D3D12-DYNAMIC-DEPTH-BIAS)Depends on: #967 (its commit is the first one here, carried for the test file)
The layer accepted both
DYNAMIC_*pipeline flags as known bits (kKnownPipelineStateFlags = 0xF) while reporting both features FALSE and implementing neither setter, so a title that used them got a PSO whose bias never changed. #967's note called that a separate decision; this is the implementation.What
ID3D12GraphicsCommandList9(generated stub regenerated for that interface, IID added to theQueryInterfacechain) and implements its two methods:RSSetDepthBias(float constant, float clamp, float slope)andIASetIndexBufferStripCutValue(value). Both record list state, deferred into bundles like the other state setters, andResetreturns them to their defaults.IASetIndexBufferStripCutValuetakes only the three defined values; anything else invalidates the list, soClosereports it.SetPipelineStatecopies the PSO's rasterizer bias andIBStripCutValueinto that state, as D3D12 does, so a draw before any setter behaves as it did.DYNAMIC_DEPTH_BIASgetsVK_DYNAMIC_STATE_DEPTH_BIASand the draw carries the values; replay issuesvkCmdSetDepthBias. A pipeline carryingDYNAMIC_INDEX_BUFFER_STRIP_CUTtakes the cut value from the draw instead of the pipeline. Pipelines without the flags are unchanged.OPTIONS16.DynamicDepthBiasSupportedandOPTIONS15.DynamicIndexBufferStripCutSupportednow report TRUE, which is the other half of #967's note.D24_UNORM_S8_UINTstored asD32_SFLOAT_S8_UINTthe pixel stage carries the bias itself (src/depth24_fragment.h), so such a pipeline keeps the PSO's bias and does not followRSSetDepthBias. Fixing that needs the values in a per-draw uniform, which is a follow-up.Tested
Windows 10 Pro 22H2 (10.0.19045), VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, NVIDIA GeForce GTX 1050 Ti (582.28) and WARP. No game files.
d3d12_gcl8_testnow covers GCL9:QueryInterfacefor the IID, both methods at their SDK slots (82, 83) with the values read back, theResetdefaults, the invalid-valueE_INVALIDARG, and the refcount. CPU only, 3/3.d3d12_depth24_draw_test: three dynamic cases on the stored-depth path. Pipeline bias 5 with a list bias of 0 stores the unbiased code (the pipeline's value is ignored); list bias 3 and -5 store codes 3 and 5 steps off the unbiased one (the list's value is applied). The two biased ones are the known native-D24rinexactness this test already reports for the static ones.d3d12_draw_test: two dynamic strip-cut passes (0xFFFF overR16_UINT, 0xFFFFFFFF overR32_UINT, on a pipeline holding DISABLED) match the PSO-driven passes pixel for pixel, 4096/4096 each.d3d12_pso_validation: passes 2/2, with #967's gate skipping the host comparison on this host (it reports both features FALSE) and a new layer-side case asserting both feature answers.ctest -Rover the seven touched and neighbouring tests with--repeat until-fail:2: 7/7. Full suite: the same five reproduced host differences plusd3d12_close_parityandroot_signature_oracle(both covered elsewhere, #989 and the finding posted for #1353); nothing new from here.check_no_game_data.pyon every touched file: 0.tests/test_docs_links.pyandtests/test_docs_table_rows.py: OK.d3d12_gcl8_teststill runs without a GPU, as before.Not tested: Windows 11, so the #967 branch that compares against a host which accepts the flags; and no title PSO was run.
GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.28, Windows 10 22H2
AI-assisted: yes (OpenCode, DeepSeek V4.1 Flash)
Checklist
mainand merges cleanly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.