Repository navigation
Conversation
|
AI-assisted independent review of Offscreen GPU check passed on both adapters. I linked a disposable harness based on the stock
The first readback matched 1024 yellow and 3072 blue pixels. The control preserved the first quadrant and added a second, matching 2048 yellow and 2048 blue. Both exited 0 with zero VUIDs and synchronization hazards. The GPU runs covered two successful single-RTV passes and readback. Two source-review findings outside that GPU fixture:
|
|
Code review of 0e4bc37 (AI-assisted). These findings don't overlap with @whattheflop's NO_ACCESS slot shift and VUID 00605 points. Differential probes compared the layer with Windows WARP on an RTX 3090 (driver 616.56, Windows 11 23H2) under
Checked and found correct:
|
|
AI-assisted follow-up to my review of 0e4bc370. I independently verified I rebuilt the exact-head runtime libraries with MSVC x64 19.38, WSDK 26100 and Ninja RelWithDebInfo, then relinked the scratch offscreen fixture. The RTX 3080 (616.64) and Radeon iGPU (1002:13c0, 32.0.21030.2001) ran serially, one native ICD per process, with an empty implicit-layer path and Khronos 1.4.363 core and synchronization validation. All six draw runs exited 0 with zero validation errors, VUIDs or sync hazards.
The trim case exercises a real blend variant. A separate CPU-only check passed 3/3 on the exact-head helper: the unbound OM slot and a blend-capable added slot each preserve the full common blend state with independentBlend disabled, and a mixed-format case with independentBlend allowed disables blending only for the simulated non-blendable slot. The mixed-format case was CPU-only. The PR description still describes the old slot-preserving and blend-padding behavior. The updated implementation and runtime docs describe raster packing and common blend-state preservation. RTV packing · Blend helper |
|
Tested Windows 10 22H2, MSVC 19.44, Vulkan SDK 1.4.363.0,
What this doesn't cover: no render-pass draw on real hardware beyond the mock-Vulkan No game files. AI-assisted (Claude Code). |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): no regression. RTX 4080 SUPER: 116/117. Not from this PR: |
|
Thanks for the review and for running the offscreen checks on both adapters.
Fixed in |
|
Tested
GitHub now reports a conflict with current AI-assisted (Claude Code). Synthetic tests only, no game data. |
|
Independent Windows verification of head I did not merge current Hardware / environment. Windows 10 build 19045, VS 2026 Community (
Full
AMD: the failure set is identical to the base ( RTX 3060: No regression from this PR on either GPU in the tested scope. The open caveat remains that these are synthetic/runtime tests; real render-pass draws from the game still need RT-5. |
80a05c6 to
9c8da91
Compare
|
Clash with #589, found by merging both onto
Cause: #589 rounds a float clear colour to the target's normalised format the way D3D does ( Fix, checked on both GPUs with #589 merged (and it still holds without #589, since these floats pass through unchanged): - c.beginning.color = {0.25f, 0.5f, 0.75f, 1.0f};
+ c.beginning.color = {0.2f, 0.4f, 0.6f, 1.0f}; // 51/255, 102/255, 153/255: exact on 8-bit UNORM
...
- expect(seen.color_clear[0].float32[0] == 0.25f && seen.color_clear[0].float32[1] == 0.5f &&
- seen.color_clear[0].float32[2] == 0.75f && seen.color_clear[0].float32[3] == 1.0f,
+ expect(seen.color_clear[0].float32[0] == 0.2f && seen.color_clear[0].float32[1] == 0.4f &&
+ seen.color_clear[0].float32[2] == 0.6f && seen.color_clear[0].float32[3] == 1.0f,With it: Whichever of the two lands second will hit this. cc #589. AI-assisted (Claude Code); results copied from the run logs. |
|
@ddm-j Thanks for the thorough report and the verified fix — applied in e0cb4c0 on The CLEAR case now uses Verified on Windows/MSVC: branch alone 154/154 ctest PASS; with #589 (ffe9b18) merged into this branch, AI-assisted. |
|
Confirmed: e0cb4c0 fixes the clash. With AI-assisted (Claude Code). |
|
Tested e0cb4c0 on RTX 5090, 621.24, Windows 11: pass. Built Render passes as dynamic rendering is the piece most likely to differ between drivers on attachment feedback, so having it default-on here and passing is worth the check. |
|
Tested |
…ering (D3D-27) Record BeginRenderPass/EndRenderPass into the command-list IR, copying every CPU descriptor at the call so later slot rewrites cannot change submitted attachments. Replay opens one vkCmdBeginRendering scope and closes it at EndRenderPass. Supported subset: PRESERVE/CLEAR/DISCARD beginning and PRESERVE/DISCARD/NO_ACCESS ending accesses; passive NO_ACCESS colour slots are dropped and remaining MRT slots compacted; depth and stencil have independent activity/aspects but share one DSV view; layout transitions run before BeginRendering; draws inside a pass take attachments and formats from the pass snapshot. Unbalanced passes fail Close, Reset and ExecuteCommandLists. Explicitly refused with a diagnostic rather than approximated: ending RESOLVE, ALLOW_UAV_WRITES, read-only depth/stencil bindings, LOCAL access types, MSAA/1D/3D and multi-planar attachments, and all nonzero render-pass flags (SUSPENDING/ RESUMING included). No suspend/resume or submit-group semantics are claimed. CheckFeatureSupport still reports TIER_0 / RenderPassesValid = FALSE. Adds command_list and replay_render_pass regression tests plus the docs/d3d12_vulkan.md section 4.3 update.
Passive NO_ACCESS colour slots keep their original OM index with a null image view and VK_FORMAT_UNDEFINED instead of being dropped and compacted, so SV_Target k still reaches attachment k. PSO format matching and the pipeline variant use the same slot indices. Fix the MSVC C4838 aspect-flag cast, set the primitive-restart function pointer in the replay test mock, and validate CLEAR depth in [0,1] at record time. Regression tests cover an interior passive slot in both the captured VkRenderingInfo and the pass-snapshot draw path.
Document that passive NO_ACCESS slots keep their index with a null image view and that Vulkan 1.3 promotes STORE_OP_NONE to core. Clarify the refused command list, the effect of rejecting RESOLVE endings on MSAA passes, the absence of a dimension/sample check, and the deliberate Reset HRESULT deviation.
… DSV (D3D-27) Build a pipeline variant whose rendering color count and formats come from the active pass so vkCmdDraw's 06179 count rule holds for any PSO RTV count, and keep the blend attachment count equal to it. Allow a two-plane D24S8 PSO in a depth-only pass by making the inactive stencil plane UNDEFINED. Correct the STORE_OP_NONE promotion attribution in the docs and cover both cases with tests.
…-27) Pipeline variants built for a render-pass draw could copy the PSO's blendEnable=TRUE into slots the pass padded or reinterpreted, invalid when the slot's format lacks COLOR_ATTACHMENT_BLEND_BIT (VUID 06062). A shared helper now keeps the PSO's blend state only for its own real formats and disables blending elsewhere; the write mask is preserved so attachments stay identical when independentBlend is off (VUID 00605). The replay test covers padded and reinterpreted slots. Document the remaining render-pass caveats: dropped RTV writes, inactive test planes, exact depth-format matching.
127e5b3 to
1d262d8
Compare
|
Native Windows render-pass readback on I also adapted the synthetic draw fixture for a real Five synthetic shaders passed |
|
Tested Windows 11, MSVC 14.44.35207 (VS Build Tools 2022, |
Negative control (build-level; this PR's own test is IR-level, so no runtime revert is possible). Reverting Commands: |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
|
Tested
No game files. AI-assisted (Claude Code). |
Claimed in the coordination issue as: D3D-27 (claim; critical path #313)
What and why
ID3D12GraphicsCommandList4::BeginRenderPass/EndRenderPasshad no replay path: the layer rebuilt a rendering scope per draw from the bound RTVs/DSV, losing the pass-lifetime attachment set, in-pass clears and access hints. This records both calls into the command-list IR, deep-copying every CPU descriptor at the call so rewriting a slot beforeExecuteCommandListscannot change what is submitted, and replays the pass as onevkCmdBeginRenderingscope closed atEndRenderPass.Supported subset:
DONT_CARE/LOAD/CLEAR; a bound DSV plane with beginning NO_ACCESS still bindsDONT_CAREbecause core 1.3 has no "do not load" op (LOAD_OP_NONEwould needVK_KHR_load_store_op_none), while a colour slot with beginning NO_ACCESS is not raster-bound and is skipped entirely (see the packing rule below). Ending PRESERVE/DISCARD/NO_ACCESS map toSTORE/STORE_OP_NONE/STORE_OP_NONE(VK_ATTACHMENT_STORE_OP_NONEis core in Vulkan 1.3, promoted withVK_KHR_dynamic_rendering, notVK_KHR_load_store_op_none; no extension is enabled).BeginRendering; a draw inside a scope takes attachments and PSO formats from the pass snapshot, not the stale OM bindings (VUID 08910), and emits no barrier inside the scope.VkRenderingInfoand the pipeline variant use that packed count and order, ending access does not change what is bound, andSV_Target iaddresses packed raster surface i — in the spec's example, pass surfaces [2] and [4] are what the PSO's entries [0] and [1] render to.RTVFormatscount and the pass's raster count are independent in D3D12, so a draw inside a pass binds a pipeline variant whoseVkPipelineRenderingCreateInfo::colorAttachmentCountequals the pass raster count: missing PSO RTVs are padded and extra ones dropped with UNDEFINED formats (VUID 06179). An active slot present in both with two different real formats is refused as a genuine mismatch. The variant's blend attachments start from the PSO's blend states, padding new slots with the first state, so the array stays identical whenindependentBlendis off (VUID 00605);VK_FORMAT_UNDEFINEDslots keep their state and are exempt from the blend-format check, matching the validation layers' explicit skip of UNDEFINED formats. When blending is enabled and a padded or pass-reinterpreted slot's real format lacksVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, blending is disabled on that slot alone ifindependentBlendis available, and otherwise the draw is refused with a diagnostic before pipeline creation (VUID 06062). The blend attachment count always equals the rendering count (VUID 06055).BeginQuery/EndQuery),ExecuteIndirectand predication are refused in preparation rather than approximated. An unclosed pass failsClose, the error is persisted and surfaced again byReset(a deliberate second signal so a caller that ignoresClosecannot miss the rejected pass), and the queue refuses the list before any batch is emitted.CheckFeatureSupportstill reportsRenderPassesTier = TIER_0andRenderPassesValid = FALSE.Explicitly refused with a diagnostic instead of being silently approximated:
ResolveSubresource/the depth-resolve replay path instead.ALLOW_UAV_WRITES— UAV writes cannot be expressed inside this replay scope, so the list is refused rather than the writes dropped.VK_RENDERING_SUSPENDING/RESUMING_BITandVkRenderingAttachmentInfo.resolveMode, but this layer has no path for them and claims no matching submit-group/flags semantics.RTVFormatsentry that is typeless while the bound RTV carries a concrete format is legal D3D12, but this replay refuses it as a real-format mismatch with a diagnostic instead of producing a pipeline that does not match the views (depth/stencil formats already had to match exactly).prepare_render_pass; the views RTV/DSV creation can produce are the practical limit and such a view is not specially diagnosed.Review follow-up
Both findings from @whattheflop's review are addressed in
9c8da913:VkRenderingInfoand the pipeline variant sharing the packed count and order. Regression tests cover skipped leading/middle/trailing NO_ACCESS slots (including NO_ACCESS/PRESERVE), aDISCARD/NO_ACCESSslot that still binds its view, and a single-RTV PSO over[NO_ACCESS/NO_ACCESS, CLEAR/PRESERVE]rendering to target 0 via the base pipeline.VK_FORMAT_UNDEFINEDslots are exempt from the blend-format check as the Khronos validation layers are; withindependentBlendoff the array stays identical (VUID 00605). A real format lackingVK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BITused with blending enabled disables blending on that slot alone whenindependentBlendis available, and is refused with a diagnostic before pipeline creation otherwise (VUID 06062). The out-of-pass unbound-RTV path keeps upstream's blend array.Known limitations
On the depth/stencil plane, a beginning NO_ACCESS with an ending PRESERVE marks the plane active and binds it with a DONT_CARE load and STORE. D3D12 promises the plane's contents survive the pass, but on TBDR GPUs DONT_CARE + STORE can write undefined content and break that promise; the colour path handles the same combination correctly by not binding the slot, and there is no test covering NO_ACCESS + PRESERVE.
No
Depends on:. Based on upstream/maindde82f27(previously3faac557). Diff: 9 files, +1318/-108. The last commit makes the CLEAR test colours exact on 8-bit UNORM so the test also passes with #589's quantized clears (found by @ddm-j).Rebase note
Rebased onto main
dde82f27: adapted to main's movedReplayResultenum withinvalid_draw(addinginvalid_render_pass), the #6610ExecuteCommandListsnull-array/queue/list-type/list->invalid()ordering (the unbalanced-pass rejection stays before the generic invalid check), the DrawViews inlining (pass-snapshot attachments, nothing propagated out to the command list), main's mesh dynamic-state VUID handling, and the five-argumentvariant_blend_statescall; #589's quantized clear-colour helpers were preserved byte-for-byte. Thanks to @Stalkerino for the conflict-resolution suggestion ind61387fc, which yielded a semantically identical result and was used as the comparison for this rebase.Tested
Environment: Windows 11 Pro (10.0.26200), MSVC 19.44.35229, NVIDIA GeForce RTX 5070 Ti (driver 617.42), Vulkan SDK 1.4.363.0. Head:
1d262d8b20b7db613cf0598c931d704458380a98.cmake -S runtime -B <build dir> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON, thencmake --build <build dir> -j 4): 686/686 targets, no errors or warnings.ctest -C RelWithDebInfo -j 4 --output-on-failurewithLEONIDA_VK_VALIDATION=1: 98% passed (268/273), 5 failed, 11 skipped/disabled, 178.52 s.replay_render_passPASS in the full run and standalone with validation (0 VUIDs, 0 validation messages);command_listPASS. No render-pass regression.VUID-vkCmdDrawMeshTasksEXT-pipelineStatistics-07076from mesh/pipeline-statistics queries; all 3 reproduce withd3d12_meshalone and none withreplay_render_pass, so they are not from this change.vk_queueRuntime: a full barrier between two ExecuteCommandLists of one queue #5997,d3d12_vulkan_deviced3d12_vulkan_device: check PC CreateReservedResource2 behind the Xbox proxy, not through slot 78 #7125,d3d12_indirect_dispatch_counttest: root UAV s4:s5 in the counted indirect dispatch shader #6566,d3d12_depth_resolved3d12_depth_resolve: check refused resolves against a destination cleared in its own list (#6610 follow-up) #7905/d3d12_depth_resolve: read a refused resolve's destination through a list of its own #7930,d3d12_meshRuntime: mesh-draw statistics segments count no clipping (VUID-07076); clipping from mesh-primitives queries #7112) and not from this change;d3d12_depth_resolvealso fails when run alone (9.06 s), so it is not a scheduling flake.dde82f27; merges cleanly into current main (git merge-tree --write-treereports no conflicts).Earlier results (superseded by the run above): clean MSVC RelWithDebInfo builds at
9c8da913(455/455) and mainaa2988cc(453/453) with 0 new warnings; ctest 145 passed/0 failed (normal) and 146 passed/0 failed (validation),replay_render_pass+command_list2/2, andreplay_render_pass_test.exedirect run passing with mock-based blend-format coverage.AI-assisted.
Checklist
docs/design.md, with how it was confirmed — N/A: runtime-only change, no translator rule.