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. |
…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.
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 (Claude Code orchestration; GLM sub-agent). |
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.No
Depends on:. Based on upstream/mainaa2988cc(ahead 7, behind 0). Diff: 9 files, +1315/-107. The last commit (e0cb4c08) makes the CLEAR test colours exact on 8-bit UNORM so the test also passes with #589's quantized clears (found by @ddm-j).Tested
Tested on: NVIDIA GeForce RTX 5070 Ti, driver 617.42, Windows 11 25H2 (build 26200.9974), Vulkan SDK 1.4.363.0, MSVC 19.44.35229.0, Ninja, RelWithDebInfo. Synthetic tests only.
-j 4: 455/455 targets on9c8da913and 453/453 on upstream/mainaa2988cc, both exit 0. Both builds logged the same MSVC C4456 and GLSL precision warnings. 0 new warnings.ctest -C RelWithDebInfo -V(normal): branch 145 passed / 0 failed / 9 skipped / 1 disabled. Clean main 144 passed / 0 failed / 9 skipped / 1 disabled.ctest -C RelWithDebInfo -VwithLEONIDA_VK_VALIDATION=1: branch 146 passed / 0 failed / 8 skipped / 1 disabled. Clean main 145 passed / 0 failed / 8 skipped / 1 disabled. Both logged the intentionalWRITE_AFTER_WRITEfrom thevk_sync_validationself-test. No VUIDs or new validation diagnostics.ctest -R "^(replay_render_pass|command_list)$": 2/2 passed in both modes.replay_render_passis the only additional test compared with clean main.replay_render_pass_test.exe(direct, exit 0): skipped leading/middle/trailing NO_ACCESS slots (including NO_ACCESS/PRESERVE) while a DISCARD/NO_ACCESS slot still binds its view with DONT_CARE/STORE_OP_NONE; a single-RTV PSO over[NO_ACCESS/NO_ACCESS, CLEAR/PRESERVE]binds the first raster RTV at target 0 with the base pipeline; the variant follows the packed order with differing active formats; and the full variant blend array — UNDEFINED and blend-capable padding, a blend-unsupported real format under bothindependentBlendfeature states (slot-local disable vs diagnostic refusal), and the out-of-pass unbound-RTV variant. The blend-format coverage is mock-based and does not rely on GPU feature emulation.AI-assisted (Claude Code orchestration; Hy4/GLM sub-agents)
Checklist
docs/design.md, with how it was confirmed — N/A: runtime-only change, no translator rule.