Repository navigation
Conversation
…s (D3D-437) STENCIL on a D32_FLOAT view used to make prepare return invalid_clear, so the whole command list was dropped. Like the PC runtime (WARP), the absent plane is now ignored: STENCIL alone clears nothing, DEPTH | STENCIL clears the depth plane. d3d12_clear_test compares three such cases with WARP. AI-assisted.
|
Static verification only (no compiler/MSVC/cmake here): The logic is right: both aspects are built, masked to One real gap: the new cases run only in the no-argument mode, which is not registered in CTest ( Nit: Approve with the CTest registration. AI-assisted review, no game files, no GPU. |
|
Tested
AI-assisted (Claude). No game files. |
|
Windows + GPU check: NVIDIA GeForce RTX 5080 (driver 621.01) + AMD Radeon 610M iGPU (driver 32.0.13018.6), Windows 11, MSVC (VS BuildTools 18) + Ninja, RelWithDebInfo, Vulkan SDK headers fetched. Tested head Build: clean, 363 targets, no warnings-as-errors failures. Targeted (the PR's own change):
Full suite (
The PR's unstable CI state did not reproduce locally. Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Also tested No game files. AI-assisted (Claude Code). |
slopradish
left a comment
There was a problem hiding this comment.
Reviewed and applied the same replay fix in my fork's diverged tree; both build and full ctest green (fork 16/16, upstream-based worktree 55/55).
The change is correct: aspects & ~available previously rejected any clear flag for a plane the view's format lacks, which is not what D3D12 does. Masking aspects with available and setting p.skip when nothing remains matches WARP and native drivers; I checked that emit() honours p.skip for clears (there are existing skip paths at the prepare/emit boundary), so no vkCmdClearDepthStencilImage is issued for an empty aspect set.
One thing worth confirming before merge: detail::view_range() is now called with aspects == 0 before the p.skip check in the test helper path — if any assertion inside it requires a nonzero aspect mask, moving if (!aspects) p.skip = true; ahead of the view_range call would be safer. The order in the diff is view_range then p.skip, which passed the local suite, so this is a defensive note rather than a blocker.
No GPU-specific hardware needed for this review.
|
Tested
AI-assisted (Claude Code). |
|
Tested
AI-assisted run (Claude). No game files involved. |
Requested by Lucas · project thread
Claimed in the coordination issue as: D3D-437 (from #313's Up for grabs), #4084 (comment)
What and why
ClearDepthStencilViewwith theSTENCILflag on a depth-onlyD32_FLOATview madeprepare(runtime/src/vulkan_replay.h~2415) returninvalid_clear. The whole command list was then dropped, including a later valid depth clear, whileCloseand the fence still succeeded. @inerthel-agi found it in #4084: native D3D12 (WARP and an RTX 5070 Ti) ignores the absent plane.Change (
runtime/src/vulkan_replay.h, theClearDepthStencilcase ofprepare):STENCILalone on a depth-only view becomes an empty clear, and that command is skipped. Without the skip it would be issued with an aspect mask of 0, which Vulkan forbids.DEPTH | STENCILclears the depth plane.invalid_clear, as before.docs/d3d12_vulkan.mdnotes the rule.Tested
Windows 11, MSVC,
VK_LOADER_LAYERS_DISABLE=~implicit~, one GPU at a time.New cases in
runtime/test/d3d12_clear_test.cpp, each compared with WARP: threeD32_FLOATclear pairs.DEPTH | STENCILclear, then aDEPTHrectangle.DEPTHclear, then aSTENCIL-only rectangle.DEPTHclear, then aDEPTH | STENCILrectangle.clear_depth_and_readtakes optional flags for its two clears.Results:
d3d12_clear_testdevice: AMD Radeon(TM) Graphics, selected withVK_LOADER_DRIVERS_SELECT=*amd*)RTV and DSV clears: 200 full/rectangle readbacks matched WARPmain:R8G8B8A8_UNORM/SNORM,B8G8R8A8_UNORM,B8G8R8X8_UNORM(7f vs 80), andD16_UNORM(@ismailchaka1's finding in #3796).vulkan_replay.hreverted): all 3 new cases differ from WARP on the Radeon.aspects &= depth_stencil_aspects). Case 1 fails on the Radeon. Then I reverted it.shader_library_corpus,fsr_dispatch,bvh_builder,vk_sync_validation,d3d12_first_light.gameinputis disabled.AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (No translator rule: the layer rule is indocs/d3d12_vulkan.md.)