d3d12: a depth-bounds test without a DSV is dropped, not refused (RT-STATE-DEPTH-BOUNDS-NO-DSV) #2474
Closed
leonida/mandy
Tyrannys wants to merge 0 commits from
rt-state-depth-bounds-no-dsv into main
pull from: rt-state-depth-bounds-no-dsv
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2474
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-state-depth-bounds-no-dsv"
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 closed
This pull request cannot be reopened because the branch was deleted.
Claimed in the coordination issue as: RT-STATE-DEPTH-BOUNDS-NO-DSV (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7222238523)
What and why
Item 7 of @kevincommits'
RT-STATE-AUDIT-PIPELINEfinding in #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7221587976), part of #2464 Part B. Thanks for the audit.create_graphics(runtime/shims/d3d12_vulkan_device.cpp) keptDEPTH_STENCIL1/2DepthBoundsTestEnablewhen the PSO has no depth-stencil format. Such a PSO was:E_NOTIMPL) on a device without thedepthBoundsfeature, anddepthBoundsTestEnableand a dynamicVK_DYNAMIC_STATE_DEPTH_BOUNDS, but no depth attachment.With no depth there is nothing to test against the bounds. The native path (
d3d12_xs_native_pso.h) already strips depth state without a DSV. So the test is now dropped whenDSVFormat == DXGI_FORMAT_UNKNOWN, before the feature check and the pipeline state are built. A PSO with a DSV is unchanged: it still needsdepthBounds.Tested
Windows 11, MSVC (VS 18), Vulkan SDK 1.4.341, RelWithDebInfo, on
mainec91d695c.d3d12_pso_validation_test(its layer device enables nodepthBounds): a stream PSO withDEPTH_STENCIL1DepthBoundsTestEnable = TRUEand no DSV must be made, and the same with aD32_FLOATDSV must still be refused withE_NOTIMPL. Withmain'sd3d12_vulkan_device.cppthe first check fails (E_NOTIMPL, "depth-bounds tests need depthBounds, which the device lacks"); with the fix both pass.d3d12_mesh_testhad the same case without a DSV and expectedE_NOTIMPLon devices without the feature, which is the behaviour being fixed. It now adds aD32_FLOATDSV to that stream, so the "refused without the feature" branch still tests the refusal, and checks the no-DSV stream is made on any device.ctest -R "^(d3d12_mesh|d3d12_mesh_heavy_cache|d3d12_pso_validation|pso_stream|d3d12_draw)$": 5/5 pass;d3d12_mesh,d3d12_pso_validationandd3d12_drawalso pass withLEONIDA_VK_VALIDATION=1.scripts/check_no_game_data.py: clean.GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Tested on a Mac under Wine. This is the case Macs hit on every depth-bounds PSO, since MoltenVK (and KosmicKrisp) lack
depthBounds:d3d12_pso_validationd3d12_meshmainmain, no fixFAIL [stream: depth bounds without a DSV]: layer returned 0x80004001, expected S_OK(line 474: no_dsv == S_OK)main+ this PRSo on a device without
depthBounds, a depth-bounds PSO with no DSV went from refused (E_NOTIMPL) to created. A PSO that does have a DSV is still refused there (d3d12_vulkan_device.cppdepthBounds check), as before.GPUs tested: Apple M3 (profile S), macOS 26.5.1, Wine 11.0 (WineHQ macOS build) with its MoltenVK 1.4.1, clang-cl/lld-link 23.1.6 cross build,
mainec91d695c. No game files. MEASURED, 1 run each.AI-assisted (Claude Code, Claude Opus 5.5).
Independent Linux/Wine + NVIDIA check at head
cdf2db2df(merged cleanly ontoorigin/mainc0201a806alongside#2480,#2478,#2477,#2476).7.2.15,wine-11.22,clang-cl+xwincross-build, NVIDIA GeForce RTX 3070 Ti 8 GB, driver620.73.04, Ryzen 7 5800X, 32 GB RAM. No game files.d3d12_pso_validation: passed (5.95 s) on RTX 3070 Ti under Wine.d3d12_mesh: passed (6.12 s),d3d12_mesh_heavy_cache: passed (6.15 s).AI-assisted.
Tested for #2464 as Aslanek asked: unit tests and a game run on my machine; CI ignored for now as asked.
Reading (marked):
Limits: one machine, one run for the PR, one run for each main witness.
AI-assisted (Claude Code, Claude Opus 5.5)
Reviewed at head
cdf2db2dfon Windows 11 (MSVC 202219.44) with dual-GPU Vulkan validation (LEONIDA_VK_VALIDATION=1, Vulkan SDK1.4.363.0).Verification
d3d12_pso_validation_testandd3d12_mesh_test.d3d12_pso_validation_test(LEONIDA_VK_VALIDATION=1): PASS (62 layer checks, 100 host comparisons across 2 host devices) on both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02), 0 validation errors.d3d12_mesh_test(LEONIDA_VK_VALIDATION=1): passed on RTX 5080 (0 validation errors); on AMD Radeon, all mesh/PSO checks passed and only the pre-existingmixed.GSInvocations == 0statistics check at line 780 failed (unrelated to this PR).Notes
DSVFormat == DXGI_FORMAT_UNKNOWNbefore feature validation and metadata storage (d3d12_vulkan_device.cpp:11775-11815,12295-12347,12470-12474,17939) while still enforcing the feature for typed DSVs matches the DirectX Depth Bounds spec.Approve.
AI-assisted review + local MSVC/dual-GPU verification.
Reviewed
cdf2db2dfand tested the new depth-bounds-without-DSV cases on live Vulkan.Code audit:
runtime/shims/d3d12_vulkan_device.cpp: clearingdepth_boundswhendesc.DSVFormat == DXGI_FORMAT_UNKNOWNmatches D3D12 / native PSO behavior (no depth attachment to bounds-test) instead of refusing PSO creation on devices withoutdepthBounds.d3d12_pso_validation_test.cpp(section 5b) andd3d12_mesh_test.cppcover both the no-DSV drop and the with-DSV rejection/behavior.Verification (Windows 11, MSVC 19.44, Ninja Release,
LEONIDA_VK_VALIDATION=1):d3d12_pso_validation_testandd3d12_mesh_test.ctest -R '^d3d12_mesh$': 1/1 passed.d3d12_pso_validation: both new section 5b checks (stream: depth bounds without a DSV->S_OKandD32_FLOAT->E_NOTIMPL) passed; the binary later failed on the unrelated pre-existing host-D3D12 parity checkgfx: Flags=DYNAMIC_DEPTH_BIAS(layer 0x00000000 != host 0x80070057, inboxd3d12.dllon this machine rejectsD3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS).python -I scripts/check_no_game_data.py: passed.GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341,
VK_LAYER_KHRONOS_validation1.4.363).AI-assisted (Antigravity, Gemini).
#2474 | head cdf2db2dfccf70798b22042f695ef6e764c17da2 (merged cleanly with main adfb3821a23612263c1c5b195453ed01c4c114db) |
ctest --test-dir runtime/build -C RelWithDebInfo -R "^(d3d12_pso_validation|d3d12_mesh|d3d12_mesh_heavy_cache|pso_stream|d3d12_draw)$" --output-on-failure(LEONIDA_VK_VALIDATION=1) | red on main:d3d12_pso_validationfails (FAIL [stream: depth bounds without a DSV]: layer returned 0x80004001, expected S_OK,line 474: no_dsv == S_OK) | green on PR+main:5/5CTests (d3d12_pso_validation,d3d12_mesh,d3d12_mesh_heavy_cache,pso_stream,d3d12_draw) pass on RTX 3090 in3.14 swith0Khronos validation errors;check_no_game_data.py0violations | Windows 11, MSVC 19.44, RTX 3090, Vulkan SDK 1.4.363.1 | AI-assisted: yesRUN #2474 (depth-bounds test without a DSV)
cdf2db2dfccf70798b22042f695ef6e764c17da2, mainbd643e46e784daf6bf3a45d09f0ec20e669c4ddb.git merge --no-ff), no conflicts, nothing pushed.cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ONcmake --build runtime/build -j 6 --target d3d12_pso_validation_test d3d12_mesh_test gta6rtctest --test-dir runtime/build -C RelWithDebInfo -R "^(d3d12_pso_validation|d3d12_mesh|d3d12_mesh_heavy_cache)$" --output-on-failure -j1(once as is, once withLEONIDA_VK_VALIDATION=1)runtime/shims/d3d12_vulkan_device.cppreverted to main's version. The API does not change, so this is a real behavioural red, not a build failure. 0 of 3 pass:d3d12_pso_validation:FAIL [stream: depth bounds without a DSV]: layer returned 0x80004001, expected S_OK(line 474: no_dsv == S_OK)d3d12_meshandd3d12_mesh_heavy_cache:line 359: SUCCEEDED(create(device.p, bad, no_dsv)) && no_dsv.pLEONIDA_VK_VALIDATION=1.dumpbin /imports).RTX 3090 / 621.40, validation on, cdf2db2df merged onto main c38c9e6a4: d3d12_pso_validation PASS (62 layer checks, 100 host comparisons across 2 host devices) (main 60 layer checks, 100 host comparisons, also PASS). d3d12_mesh and d3d12_mesh_heavy_cache exit 0 on both: 4096 pixels matched, 9 stream PSOs refused as invalid, 2 as not implemented. No validation errors.
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.