RT-STATE-AUDIT-FORMATS: honor D3D12_DSV_FLAG_READ_ONLY_DEPTH and READ_ONLY_STENCIL #2480
Closed
leonida/mandy
lixonik wants to merge 0 commits from
rt-state-audit-formats-dsv-readonly into main
pull from: rt-state-audit-formats-dsv-readonly
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!2480
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-state-audit-formats-dsv-readonly"
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.
Part of
RT-STATE-AUDIT-FORMATS(#2464; based on the format-state audit notes in #1608 by@kevincommitsand@Tauwni).Summary
dsv_read_only_depth,dsv_read_only_stencil) onTargetView(runtime/src/command_list.h;sizeof(TargetView) == 32 <= kDescriptorSize).desc->FlagsinCreateDepthStencilView(runtime/shims/d3d12_vulkan_device.cpp), rejecting unknown flag bits and recordingD3D12_DSV_FLAG_READ_ONLY_DEPTH/D3D12_DSV_FLAG_READ_ONLY_STENCIL.runtime/src/vulkan_replay.h:VkRenderingAttachmentInfofor depth and stencil withVK_ATTACHMENT_STORE_OP_NONE, read-only access masks (VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT), and per-aspect read-only layouts whenseparate_depth_stencil_layoutsis enabled (orDEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL/DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMALwhen coupled).VK_IMAGE_LAYOUT_GENERALfor read-only depth/stencil with bindless sampling where the Vulkan attachment access rules allow it. Simultaneous sampling of one aspect of a packed depth/stencil image while storing the sibling on devices withoutseparateDepthStencilAttachmentAccessremains open. When the sampled aspect entered the draw in GENERAL, replay restores that layout for subsequent reads after the attachment scope ends. See the review.ClearDepthStencil.GraphicsPipeline::read_only_depth/read_only_stencilvariant bits (runtime/src/vulkan_replay.h,runtime/shims/d3d12_vulkan_device.cpp) so pipelines withDepthWriteMask = ALLor nonzero stencil write masks suppress writes cleanly when drawn against a read-only DSV (no variant is built when the PSO already disables writes).Tests
runtime/test/d3d12_dsv_readonly_test.cpp(d3d12_dsv_readonly, skips with 77 if no Vulkan GPU): exercises unknown-flag rejection, mixedREAD_ONLY_DEPTH+ writable stencil, mixed writable depth +READ_ONLY_STENCIL,READ_ONLY_DEPTH | READ_ONLY_STENCIL, read-onlyClearDepthStencilViewmasking, andD32_FLOATREAD_ONLY_DEPTHon GPU.runtime/test/dsv_readonly_replay_test.cpp(dsv_readonly_replay, CPU-only, no GPU required): verifies attachment layouts,storeOp, barrier access masks,separate_depth_stencil_layoutstrue/false,sampled_in_general, write-suppression variant requests, andClearDepthStencilread-only skipping.Negative control & verification
main(ec91d695c),d3d12_dsv_readonly_testfailed all 6 GPU checks on RTX 5070 (unknown flag0x4accepted,READ_ONLY_DEPTHoverwrote depth to0x400000causing the second draw to fail depth test,READ_ONLY_STENCILandREAD_ONLY_BOTHmodified depth/stencil, partial clear overwrote read-only depth, andD32_FLOATREAD_ONLY_DEPTHoverwrote0.75with0.25).ctest -R "^(dsv_readonly_replay|d3d12_dsv_readonly|d3d12_state_map|vk_command_replay|d3d12_depth24_draw|d3d12_typeless_depth)$": 6/6 passed.python scripts/check_no_game_data.py: clean.python -m unittest tests/test_ctest_registration.py: 6/6 OK.git diff --check: clean.GPUs tested: NVIDIA GeForce RTX 5070 (Windows 11, native Vulkan;
VK_LAYER_KHRONOS_validationnot installed locally).AI-assisted.
Independent Vulkan validation on RTX 3080: four synthetic DSV tests passed, including the precise-occlusion assertion. That run covers the D32 control. Test report.
Follow-up after merging main
At
c6fabd3395withmainbd643e46e7, both sides' CMake test registrations are present. On Windows 10 22H2, RTX 5070 (610.88), MSVC 19.44 and Khronos validation, all four selected tests passed:dsv_readonly_replay,d3d12_dsv_readonly,depth24_cpu, andd3d12_depth24_draw. The same-draw packed depth/stencil case described above remains open.Independent native Linux GPU follow-up at
c6fabd339on RADV and NVIDIA confirmed that the post-render transition restores shader reads inGENERAL. All eight mixed draws and eight sample-only controls returned the expected pixels with synchronization validation enabled. Removing only the restoration triggered a descriptor/image layout validation error in all eight recordings. Test reportIndependent Linux/Wine + NVIDIA check at head
86b890ca1(merged cleanly ontoorigin/mainc0201a806alongside#2478,#2477,#2476,#2474).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_dsv_readonly: passed (6.06 s) on RTX 3070 Ti under Wine.dsv_readonly_replay: passed (4.42 s) under Wine.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 the main witness.
AI-assisted (Claude Code, Claude Opus 5.5)
Reviewed at head
86b890ca1on Windows 11 (MSVC 202219.44) with dual-GPU Vulkan validation (LEONIDA_VK_VALIDATION=1, Vulkan SDK1.4.363.0).Verification
dsv_readonly_replay_test,d3d12_dsv_readonly_test,d3d12_depth24_draw_test, andgta6rt.dsv_readonly_replay_test: passed (8/8 checks).d3d12_dsv_readonly_test(LEONIDA_VK_VALIDATION=1): passed with 0 validation errors on both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02).d3d12_depth24_draw_test(LEONIDA_VK_VALIDATION=1): passed on both RTX 5080 and AMD Radeon (0 validation errors).Findings (Request changes)
VK_IMAGE_LAYOUT_GENERAL(vulkan_replay.h:5592-5601,3046-3059):On the normal bindless path (
sampled_in_general),image_layout()mapsDEPTH_STENCIL_READ_ONLY_OPTIMALand the mixed read-only layouts toVK_IMAGE_LAYOUT_GENERAL.detail::to_attachment()emits the layout transition withdstAccessMasklimited toVK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT(ordepth_access) anddstStageMasklimited toEARLY_FRAGMENT_TESTS | LATE_FRAGMENT_TESTS. If a resource is already inD3D12_RESOURCE_STATE_DEPTH_READ | NON_PIXEL_SHADER_RESOURCE(orPIXEL_SHADER_RESOURCE) and transitions from attachment layout toGENERALat draw time without an intervening D3D12 barrier, a shader sampling the read-only depth/stencil in that draw (e.g., vertex/mesh/fragment) is outside the barrier's destination scope. The coupled-plane fallback (separate == false,vulkan_replay.h:1738-1742) has the same destination scope gap. Please includeVK_ACCESS_SHADER_READ_BITand the consuming shader stages when transitioning into a shader-readable/general layout.STOREvs.GENERALsampling (vulkan_replay.h:434-439,5603-5610;d3d12_vulkan_device.cpp:22013-22016):A mixed read-only D24S8 draw sets
STORE_OP_NONEon the read-only aspect andSTORE_OP_STOREon the writable sibling while placing the read-only aspect inGENERAL. Per the Vulkan render pass store-operation rules, on implementations whereVkPhysicalDeviceMaintenance7PropertiesKHR::separateDepthStencilAttachmentAccess == VK_FALSE, storing the writable sibling aspect can still read/write back the read-only aspect, racing a shader sampling it. Device selection currently checksseparateDepthStencilLayoutsonly, andd3d12_dsv_readonly_testuses an empty pixel shader without SRV sampling so it does not exercise this case. Please gate or guard simultaneous sampling of a packed depth/stencil aspect whenseparateDepthStencilAttachmentAccessis unavailable.d3d12_com.cpp:2042-2047;d3d12_vulkan_device.cpp:12922-12939):Under
LEONIDA_ASYNC_PIPELINES=1,request_draw_pipeline()/request_early()only passesdepth_.resource != 0and omitsdepth_.dsv_flags. Recording pre-compiles the writable variant, while replay requests the read-only variant key (vulkan_replay.h:2872-2889), which can cause the first read-only draw to be skipped while that variant compiles. Passingdepth_.dsv_flagsintorequest_pipeline_build/request_earlykeeps recording and replay in sync.rect_view(vulkan_replay.h:3675-3678):When read-only flags mask out all requested clear aspects, line 3675 sets
p.skip = true, but line 3676 still unconditionally callsrect_view(...). With non-emptyrects, that still requiresrenderinghooks and allocates an image view (and can returnunsupportedif!rendering) for a no-op clear. Guardingrect_viewwithif (!p.skip)afterview_range()avoids this.d3d12_dsv_readonly_test.cpp:181-187,451):The test writes shaders to a fixed temp directory name and removes it on exit, which can collide if two instances run concurrently (including PID or a unique suffix avoids that).
AI-assisted review + local MSVC/dual-GPU verification.
KLBF #27 supplies a separate depth-bounds control. For the read-only DSV fix, run otherwise identical draws with write enabled, read-only depth and no stencil attachment. Match query and color results while asserting the depth value can change only in the writable arm. That independently checks bound state and masking.
@timbot103 @akimfomin Addressed all review findings and added the paired writable-vs-readonly D32 control in
2f5e8a808:equest_pipeline_build -> PipelineState::request_early so recording pre-warms the same
ead_only_depth /
ead_only_stencil variant bits as replay.
ect_view(...) with if (!p.skip) after iew_range() so no-op rectangular clears do not require rendering hooks or allocate an image view.
Verification
GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341, VK_LAYER_KHRONOS_validation 1.4.363).
AI-assisted (Antigravity, Gemini).
@timbot103
bd9479348fixes the query assertion. Both arms must equal the expected sample count with precise queries. Without them both must be nonzero.d3d12_dsv_readonlyanddsv_readonly_replaypassed on RTX 5070.The packed depth/stencil sampled-layout issue is still open. A resource marked
sampled_in_generalmay have an SRV even when the draw does not sample it, so rejecting every mixed DSV with that flag would reject ordinary stencil draws as well. The remaining fix needs to preserve the sampled layout and identify or isolate the simultaneous read before recording the draw.AI-assisted.
Verified
bd9479348822513ff5ffab1a0c0503adb92d35b0independently on native Windows, using an RTX 3080 desktop (10 GiB, driver 630.20), Windows 11 build 26340, MSVC 19.50.35717, RelWithDebInfo and Vulkan SDK 1.4.363.1 with Khronos validation enabled.d3d12_dsv_readonlypassed with zero validation errors. This covered the D32_FLOAT writable/read-only pair and the occlusion count assertion.vulkaninforeportedocclusionQueryPrecise = truefor the RTX 3080, and the fixture enables that feature when advertised.dsv_readonly_replay,d3d12_depth24_draw, andd3d12_typeless_depthalso passed. The two shared depth controls passed at common ancestor5f3790c8e875288da8cf05081d661471088e1e0a. Overall 4/4 at the PR head and 2/2 at the ancestor, with no CTest skips.Synthetic fixtures. AI-assisted (Codex).
@timbot103
9f534d3cafixes the later-read half of the packed depth/stencil layout issue. If the sampled aspect entered a mixed draw in GENERAL and the attachment uses the optimal fallback, replay restores its GENERAL layout after ending rendering. On coupled-layout devices this restores both planes together. The mock regression fails on the previous head and now passes in both split and coupled modes.All four focused CTests passed on RTX 5070 (610.88), Windows 10 22H2, MSVC 19.44, with Khronos validation available. The simultaneous sampled draw on hardware without separateDepthStencilAttachmentAccess remains open; this change covers reads after that attachment scope.
AI-assisted.
Verified updated head
9f534d3camerged with mainaa918e5d9on physical gfx906 (RADV Mesa 26.0.8, Linux Wine 11.0). With D32 cleared to 0.75 and a draw at 0.25, main stored 0.25 through both the read-only and writable views. The merge kept 0.75 read-only / 0.25 writable. Precise occlusion counted 1,024 samples in both arms on both builds: the read-only draw ran rather than disappearing.The packed depth/stencil cases used the D32S8 fallback on this device. With depth read-only, the merge preserved 0.75 while stencil incremented twice to 18; main overwrote depth with 0.25 and stencil reached only 17. A partial clear on the merge left depth unchanged and updated stencil. Main reported one synchronization write-after-write hazard; the merged fixture passed without validation errors, hazards or device loss.
The new post-render
GENERALrestoration was checked separately at the replay boundary: 4/16 on the preceding PR head versus 16/16 on this revision across split/coupled aspect layouts, mixed entry layouts and untouched mip/layer neighbors. Only ranges that entered inGENERALwere restored. This was a host-side command/tracker check, not a physical later-sample result. Simultaneous sampling while a writable sibling stores was not tested.AI-assisted.
Checked
9f534d3caagainstmain8fb974878on Windows 11 10.0.26300: it does not merge (git merge-tree --write-tree), so I ran no tests.runtime/CMakeLists.txt, add/add.06c3b4a6a(2026-11-25, RT-D24-CPU-ROUNDEVEN) added thedepth24_cpu_testblock where this PR adds its test targets.mainhas no handling ofD3D12_DSV_FLAG_READ_ONLY_DEPTH/READ_ONLY_STENCILinruntime/shimsorruntime/src. The rebase looks mechanical: keep both CMake blocks.AI-assisted (Claude Code).
Physical follow-up for the post-render
GENERALrestoration at PR headc6fabd339, merged cleanly ontoc22a0a732(tree598d31332). I drove the production replay emitter on native Vulkan with a synthetic 8×8D32_SFLOAT_S8_UINTimage and forced the replay fallback forseparate_depth_stencil_attachment_access. Both devices advertise the capability. I ran the split and coupled layout paths independently.The test clears depth to 0.75 and stencil to 0x20. It then draws at 0.25 with the mixed read-only attachment. A subsequent compute dispatch in the same command buffer fetches the previously read-only aspect through a
GENERALdescriptor, with no image barrier inserted by the test between replay and dispatch. The writable sibling is read back separately.8/8 draws and 8/8 sample-only controls passed, including attachment layout/store-op checks. The stock CPU fixture passed 12 checks. Khronos validation and synchronization validation reported zero errors. In a separate negative-control build I removed only the post-render restoration loop. All eight recordings then reported
VUID-vkCmdDispatch-imageLayout-00344, and I discarded those command buffers before submission.AMD Raphael iGPU (RADV Mesa 26.3.1-arch3.5) and RTX 4070 SUPER (NVIDIA 620.73.04), CachyOS, native Vulkan. This covers sampling after the attachment scope. Offline, synthetic inputs, AI-assisted.
Merged
main(bfb54b8759) as1e2954d151to resolve theruntime/src/vulkan_replay.hconflict with #778 (d3d-sample-positions):GraphicsPipeline::read_only_depth/read_only_stencilto bits11/12socustom_sampleskeeps bit10.active_samplesthroughto_attachment,initialize, and the post-rendersampled_depth_stencil_restorebarrier.Local verification (Windows 11, MSVC 19.44, RTX 5070,
LEONIDA_VK_VALIDATION=1,VK_VALIDATE_SYNC=1):ctest --output-on-failure -R "^(dsv_readonly_replay|d3d12_dsv_readonly|depth24_cpu|d3d12_depth24_draw)$": 4/4 passed.python -I scripts/check_no_game_data.py: passed.git merge-tree --write-tree main HEAD: clean against1d3da5ebc7.AI-assisted (Antigravity, Gemini).
Independent Wine A/B on the current DSV revision. I built GitHub merge
717bd241(a7f11116aover497bdd039) in Win64 Release using clang-cl 23.1.5 and Windows SDK 10.0.26100. CachyOS, Wine 11.22, RTX 4070 SUPER (620.73.04) and Radeon 610M (RADV 26.3.1). Synthetic shaders and attachments.d3d12_dsv_readonly,d3d12_depth24_drawanddsv_readonly_replaypassed on both GPUs. Replay reported 12 checks. The D32 read-only draw retained 0.75, the writable control stored 0.25, and its paired occlusion checks passed.main. Both GPUs reported the same six failures. They cover unknown flags, the three D24 depth/stencil read-only combinations, the partial clear, and D32 read-only depth changing to 0.25.vkCreateDevicediagnostic on both arms and both GPUs.VK_EXT_external_memory_dma_bufwas enabled withoutVK_KHR_external_memory_fd(01387). The test logs show no additional validation error class.AI-assisted with OpenAI Codex. The observations were independently checked against the raw logs.
RTX 3090 / 621.40, validation on, a7f11116a merged onto main f9f3ec4c6: d3d12_dsv_readonly_test OK (all read-only flag cases), dsv_readonly_replay_test 12 pass, d3d12_depth24_draw_test 0 failures (main 0). No validation errors.
Fixed the
replay_state_cacheCI failure ina04eff9a4b:replay_state_cache_test.cpp's read-only DSV CPU mock to provide a pipelinevariantcallback andseparate_depth_stencil_attachment_access = true(matching theGENERALlayout path it asserts).replay_state_cache_test.cppto mark the read-only pipelines'depth_writes/stencil_writesaccurately and pass the device'sVK_KHR_maintenance7separateDepthStencilAttachmentAccessproperty intoVulkanContext(falling back toD32_SFLOATwhen the device lacks separate attachment access).Verified locally on Windows 11, MSVC 19.44, NVIDIA GeForce RTX 5070 12 GB (driver 610.88, Vulkan 1.4.341,
LEONIDA_VK_VALIDATION=1):d3d12_dsv_readonly,dsv_readonly_replay,d3d12_state_map,replay_state_cache: 4/4 passed.VK_VALIDATE_SYNC=1):d3d12_dsv_readonlyandreplay_state_cache2/2 passed.python -I scripts/check_no_game_data.py: passed;git merge-tree --write-tree origin/main HEAD: clean.AI-assisted (Antigravity, Gemini).
Re-run at a04eff9a4 on main a596adfac: d3d12_dsv_readonly OK, 0 validation errors (PR-only); dsv_readonly_replay 12 checks passed (PR-only); d3d12_depth24_draw 0 failure(s) (main 0 failure(s)); replay_state_cache ALL PASS (main ALL PASS); d3d12_state_map OK (main OK). No validation errors.
Thank you for the careful work and thorough verification here. The legacy C++/Vulkan runtime/ directory is now frozen and deprecated as active development focuses on the d3d12/ and clean-room Rust vulkan/ tracks, so we are closing open legacy runtime/ PRs. We really appreciate the effort that went into this.