vulkan: the depth24 conversion keeps its shader barriers on a copy queue (RT-DEPTH24-COPY-QUEUE-BARRIERS) #2469
Closed
Tyrannys wants to merge 3 commits from
upstream-pr/2469 into main
pull from: upstream-pr/2469
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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.
Reference
ProjectLeonida/mandy!2469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2469"
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?
Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-27T14:40:25Z.
Claimed in the coordination issue as: RT-DEPTH24-COPY-QUEUE-BARRIERS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215741391)
What and why
Found by @kevincommits in #1608 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7208331179), thanks for the precise write-up.
A D3D12 copy queue whose Vulkan family can run compute also runs the depth24/rgb96 footprint conversion:
depth24_prepareis installed whenever the family is not the transfer-only one. But that queue's replay usesqueue_stages_copy, which has noCOMPUTE_SHADERbit, so:detail::restrict_to_queuezeroed the shader access of the four barriers aroundrun_depth24(dstAccessMask = 0before the dispatch,srcAccessMask = 0after it). The copy's writes were not made visible to the shader, nor the shader's writes to the copy or readback that follows.COMPUTE_SHADERaway and fell back toTRANSFER / TRANSFER_WRITE -> HOST, so the conversion's writes were not made available to the host.This keeps the copy-queue conversion (which
depth24_convert_testexercises) and fixes its barriers:detail::depth24_barrier: the barriers around the conversion's dispatch are restricted to the queue's stages plusCOMPUTE_SHADER, the stage the dispatch already uses on that queue.restrict_to_queueandmemory_barriernow go throughrestrict_to_stages/memory_barrier_within; every other barrier is unchanged.VulkanQueueallowsCOMPUTE_SHADERwheredepth24_prepareis installed.queue_stagesitself is unchanged, so the other compute paths stay refused on a copy queue.execute_now()copiescontext_.replay_, so it now clears thedepth24_prepare/depth24_runcallbacks thatenable_depth24()put there, and such a copy is refused as unsupported. The D3D12 device now registers a copy family without compute as transfer-only on every device; before, it did so only with conditional rendering.depth24_convert_testnow watchesvkCmdPipelineBarrierthrough the context's device proc. On direct, compute and copy queues, the depth24 and rgb96 readbacks must have a barrier into the shader's reads and one out of its writes, and the host barrier must come fromCOMPUTE_SHADER / MEMORY_WRITE. The old test asserted theTRANSFERfallback on a copy queue; that assertion is replaced.Staying apart from #1988 (Depth24Converter bounds); no shared files.
Tested
Windows 11, MSVC (VS 18), Vulkan SDK 1.4.341, RelWithDebInfo, on this branch merged with
main(ec91d695c).26fd3b3bb):depth24_convert_testregisters the test's family as transfer-only and checks that depth24 and rgb96 uploads and readbacks on a copy queue returnunsupportedwith no conversion or host barriers; with the previousvulkan_backend.hit fails at that check (line 705). It also checks the conversion barriers of buffer-to-image uploads on every queue kind (@lixonik's note).depth24_convert,depth24_fragment,d3d12_d24_support,d3d12_depth24_draw,xbox_d16s8_d24_storage: pass;depth24_convertalso withLEONIDA_VK_VALIDATION=1, no messages.depth24_convert: passes, also withLEONIDA_VK_VALIDATION=1(validation and sync validation on, no messages).main'svulkan_backend.handvulkan_replay.h: fails atto_shader_barriers >= 1 && from_shader_barriers >= 1(the conversion's barriers lose their shader access). With only the replay half of the fix, it fails athost_src_stages == VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT(the host barrier). Both halves are needed.mainhere either, matching @kevincommits' note that 1.4.363 no longer flags it; the barrier check in the test is what catches it.vk_*,depth24*,replay_*,d3d12_queue*,d3d12_*copy*,predicated_copy,guarded_copy,queue_proxy,xbox_present_readback_size), 84 tests: all pass exceptd3d12_queue_handover,_two_queues,_shared_queue: failed only underctest -j 4load; pass when run alone.vk_compile_gate_calibration: "no verdict on NVIDIA (unclear)" under load; passes alone (3/3).vk_sync_validation: skipped.vk_*,depth24*,replay_*withLEONIDA_VK_VALIDATION=1(58 tests): all pass exceptvk_device_markers, which fails the same way onmain(sync validationWRITE_AFTER_WRITEbetween twovkCmdWriteBufferMarker2AMDwrites); unrelated to this change.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
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-27T15:20:38Z.
Review: COMMENTED
Reviewed and tested at
0e204a9ab(merged cleanly ontomainec91d695c).Clean, targeted fix:
replay.depth24_prepareis only installed when!transfer_only(runtime/src/vulkan_backend.h:3388), so addingVK_PIPELINE_STAGE_2_COMPUTE_SHADER_BITtoallowedfor host-readback visibility on copy queues is safe even on GPUs with a dedicated transfer-only queue family.copy_depth_uav()(runtime/src/vulkan_replay.h:3536) already refuses queues whosevk.queue_stagesomitsCOMPUTE_SHADER_BIT, so the fourCopyTextureRegiondepth24/rgb96 barriers updated todepth24_barrier()are the only ones reachable on a copy queue.watch_dispatch_barriersindepth24_convert_test.cppcurrently checks the image-->buffer readback dispatches on a copy queue; assertingto_shader_barriers/from_shader_barrierson a buffer-->image upload on a copy queue too would cover both halves of thevulkan_replay.hchange.Verified locally on Windows 11 (MSVC 19.44.35230.0, Ninja Release, NVIDIA GeForce RTX 5070, driver 610.88, Vulkan 1.4.341; note
VK_LAYER_KHRONOS_validationis not installed locally so Vulkan validation layers did not run):depth24_convert(GPU): passed (all 10 sub-checks including the new copy-queue shader barrier and host-readback visibility assertions)scripts/check_no_game_data.pyandgit diff --check: cleanNo blocking findings.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by djrolfes on 2026-11-27T15:26:28Z.
Independent Linux/Wine + NVIDIA check at head
0e204a9ab(merged cleanly ontoorigin/mainec91d695cin a local integration stack alongside#2467,#2463,#2470,#2461,#2126,#2091, and two local V# patches).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.depth24_convertpassed (14.66 s) on RTX 3070 Ti under Wine (all 10 checks including host-readback visibility barriers, shared-buffer offsets, and concurrentVulkanQueue::execute).depth24_barriercleanly preservesVK_PIPELINE_STAGE_2_COMPUTE_SHADER_BITfor copy queues running on compute-capable families without widening unrelated transfer barriers.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-27T16:17:46Z.
Tested on a Mac under Wine. On Macs every D24 depth target takes this conversion path: neither MoltenVK nor KosmicKrisp has
D24_UNORM_S8_UINT, so it's D32 there.depth24_convertd3d12_d24_supportd3d12_depth24_drawmaindepth24_convert_test.cpponmain, no fixline 635: to_shader_barriers >= 1 && from_shader_barriers >= 1main+ this PRGPUs 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).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-28T02:02:28Z.
Reviewed at head
0e204a9abon Windows 11 (MSVC 202219.44) with dual-GPU Vulkan validation (LEONIDA_VK_VALIDATION=1, Vulkan SDK1.4.363.0).Verification
depth24_convert_test.depth24_convert_test(LEONIDA_VK_VALIDATION=1): ok with 0 validation errors on both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02).Finding (Request changes)
COMPUTE_SHADERbarriers (vulkan_backend.h:3267-3270,3388-3399;d3d12_vulkan_device.cpp:14973-14992):enable_depth24()installs converter callbacks directly oncontext_.replay_. Inexecute_now(),replay = context_.replay_copies that table, and on atransfer_onlyfamily the later conditional skips wrappingprepare_depth24rather than clearing both inherited callbacks — leaving them callable on a transfer-only family.d3d12_vulkan_device.cpp:14973-14992, the only production call toset_transfer_only_family(info.copy_family)is nested insideif (info.conditional_rendering), so on devices without conditional rendering the transfer-only family is never registered at all.In either case, an aligned RGB96 copy on a DMA-only family can enter the converter and emit the new
VK_PIPELINE_STAGE_COMPUTE_SHADER_BITlegacy and sync2 barriers (vulkan_replay.h:1845-1853,5132-5141,5169-5184), violatingVUID-vkCmdPipelineBarrier-dstStageMask-06462,srcStageMask-06461, andVUID-vkCmdPipelineBarrier2-srcStageMask-09673(in addition to binding/dispatching compute on a transfer-only queue). Registering transfer-only families independently ofconditional_renderingand explicitly clearing inherited depth24 callbacks on transfer-only queues closes both paths cleanly.On compute-capable copy queues, the new converter barriers look well-scoped and ordinary copies keep their transfer-stage filter.
AI-assisted review + local MSVC/dual-GPU verification.
Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-28T13:06:31Z.
@timbot103 thanks, both paths were real. Fixed in
26fd3b3bb.execute_now()copiescontext_.replay_, and on a transfer-only family it only skipped the wrapper, sodepth24_prepare/depth24_runfromenable_depth24()stayed callable. Both are now cleared on a transfer-only family (vulkan_backend.h), so a depth24 or rgb96 copy there is refused as unsupported before anything is recorded: no dispatch and noCOMPUTE_SHADERbarrier.d3d12_vulkan_device.cppnow registers a copy family withoutVK_QUEUE_COMPUTE_BITas transfer-only on every device. Only the predication setup stays behindinfo.conditional_rendering.Test,
depth24_convert_test: the test's family is registered as transfer-only (set_transfer_only_family), and on a copy queue the depth24 and rgb96 uploads and readbacks are each checked to returnunsupportedwith no conversion barriers (shader stage, either direction) and no host-readback barrier. With the previous commit'svulkan_backend.h, it fails at that check (line 705). With the fix it passes.@lixonik's coverage note is in the same commit: on direct, compute and copy queues, depth24 and rgb96 buffer-to-image uploads now also check
to_shader_barriers/from_shader_barriers.Windows 11, MSVC (VS 18), RelWithDebInfo, RTX 4070 SUPER (driver 621.01):
depth24_convert: passes, also withLEONIDA_VK_VALIDATION=1(no validation messages).depth24_fragment,d3d12_d24_support,d3d12_depth24_draw: pass.xbox_d16s8_d24_storage: passed 5 of 5 when run alone. It timed out once when run in the same ctest batch as the other depth24 tests, so that looks like load. I have not reproduced it.scripts/check_no_game_data.py,git diff --check: clean. The branch still merges cleanly withmain.AI-assisted (Claude Code)
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T13:43:09Z.
Review: APPROVED
Re-reviewed
26fd3b3bband tested on RTX 5070 with Khronos validation enabled.Code audit:
runtime/src/vulkan_backend.h: explicitly clearing inheritedreplay.depth24_prepareandreplay.depth24_runcallbacks ontransfer_onlyfamilies ensures a transfer-only copy queue refuses depth24/RGB96 conversion as unsupported without dispatching compute or emittingCOMPUTE_SHADERbarriers.runtime/shims/d3d12_vulkan_device.cpp: registering a non-compute copy family viaset_transfer_only_family(info.copy_family)unconditionally (outsideif (info.conditional_rendering)) closes the remaining registration gap.runtime/test/depth24_convert_test.cpp: covers both transfer-only refusal and buffer-to-image uploadto_shader_barriers/from_shader_barrierschecks across direct, compute, and copy queues.Verification at
26fd3b3bb(Windows 11, MSVC 19.44, Ninja Release,LEONIDA_VK_VALIDATION=1):depth24_convert_test,depth24_fragment_test,d3d12_d24_support_test, andd3d12_depth24_draw_test.ctest -R '^(depth24_convert|depth24_fragment|d3d12_d24_support|d3d12_depth24_draw)$': 4/4 passed (0 validation errors).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).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:36:27Z.
Verified
26fd3b3bbmerged with main1bc055e6con physical gfx906, native subgroup 64, RADV Mesa 26.0.8 with synchronization validation. The samedepth24_convert_testsource failed on main and passed on the merge. Main stripped the compute-stage destination access to zero on a logical copy queue backed by a compute-capable family. A test observer captured that submission and stopped it before it reached the driver; this is a barrier failure, not evidence of corrupt pixels.On the merge, D24 and RGB96 conversions retained compute shader read/write access, and the readback barrier made compute writes visible to the host. All 1,995 scoped readback words matched the independent oracle, including 256 D24 and 153 RGB96 words on the copy queue. All 1,586 words from legally submitted main controls also matched. No validation errors, synchronization hazards or physical device loss. This device advertised no transfer-only family: the four transfer-only refusals were checked by marking the test family transfer-only, not by submitting to a dedicated DMA engine.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:27:23Z.
Review: COMMENTED
Static audit of
26fd3b3bbonly, with no builds, tests, or GPU runs. On a graphics+compute family, the legacy barriers now preserve shader reads and writes around the scratch-buffer conversion. The host barrier covers compute writes through synchronization2 and through the legacyALL_COMMANDS / MEMORY_WRITEpath. Clearing the callbacks also correctly refuses the conversion on the registered DMA family.runtime/shims/d3d12_vulkan_device.cpp:14987— This check covers the dedicated copy family. The queue picker can select a graphics family without compute atruntime/shims/d3d12_vulkan_device.cpp:22007, and a copy queue can fall back to it. An RGB96 footprint copy on that queue still dispatches compute and now records explicit compute-stage barriers, violating the queue-family stage requirements inVUID-vkCmdPipelineBarrier-srcStageMask-06461andVUID-vkCmdPipelineBarrier-dstStageMask-06462. A host-readable readback through synchronization2 also violatesVUID-vkCmdPipelineBarrier2-srcStageMask-09673. Gate the converter callbacks and host compute barrier on the capabilities of the actual queue family.runtime/src/vulkan_replay.h:5152— With no suitable DMA family, the picker can lease a copy queue from a compute-only family. That family can run the conversion shader, but the D24-as-D32 upload here and the readback atruntime/src/vulkan_replay.h:5175also issue depth-aspect buffer/image copies. Those commands requiremaintenance10and the depth-copy format feature on that family. Please check both before preparing the conversion and refuse the copy when either is missing. The existing per-format capability check inruntime/src/vulkan_replay.h:3529provides a starting point.The upload and readback assertions in
runtime/test/depth24_convert_test.cpp:623all reuse the same graphics family. The refusal check atruntime/test/depth24_convert_test.cpp:697simulates DMA by registering that family as transfer-only. Coverage of a non-graphics compute family would catch the depth-aspect copy failure.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:29:51Z.
Run on
26fd3b3bb(PR head), merged locally withmain50d09b373. Prep notes by TheGeogeo's review session.git merge --no-ff pr-2469, auto-mergedd3d12_vulkan_device.cpp,vulkan_backend.h,vulkan_replay.h). Merged commit00da55bcd, local only.cmake -S runtime -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON, thencmake --build build --target depth24_convert_test depth24_fragment_test d3d12_d24_support_test d3d12_depth24_draw_test xbox_depth_storage_test gta6rt -j 6.Green (merged build)
ctest -R "^(depth24_convert|depth24_fragment|d3d12_d24_support|d3d12_depth24_draw|xbox_d16s8_d24_storage)$" --output-on-failure -j1: 5/5 passed (depth24_convert7.1 s, actually run, not skipped).depth24_convert_testwithLEONIDA_VK_VALIDATION=1(validation on): exit 0, no validation or sync-validation messages.Red (behavioural: the test is kept and compiles against
main's sources; the three non-test files are reverted tomain)d3d12_vulkan_device.cpp,vulkan_backend.h,vulkan_replay.h:depth24_convertfails atdepth24_convert_test.cppline 637to_shader_barriers >= 1 && from_shader_barriers >= 1(the conversion's barriers lose their shader access). It fails the same way withLEONIDA_VK_VALIDATION=1; validation itself printed nothing, so on this GPU and SDK the barrier counter is what catches it, not sync validation.vulkan_replay.hfrom the PR (backend and device frommain): fails at line 652host_src_stages == VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT(host barrier).vulkan_backend.handd3d12_vulkan_device.cppfrom the PR (replay frommain): fails at line 637 again.Link: gta6rt.exe of the merged build: no new imports vs main (703 imports, identical lists with
dumpbin /imports).Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44, Vulkan SDK 1.4.363.1. One run each.
AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:44:54Z.
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.Pull request closed