Repository navigation
Conversation
…list clear_unordered_access refused a rectangle with right < left or bottom < top. The refusal marks the list invalid, Close answers E_INVALIDARG and the whole ExecuteCommandLists is dropped. D3D12 closes and runs such a list and writes nothing for that rectangle (measured on WARP and an NVIDIA device without the debug layer, for a texture view and a buffer view), and ClearRenderTargetView already accepts it here. The recorder now leaves out rectangles that are inside out or empty, and records no command when none is left, since a command without rectangles clears the whole view. command_list_test covers the recorder; d3d12_uav_clear_test runs a buffer and a texture case and no longer expects E_INVALIDARG. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
al3xar
left a comment
There was a problem hiding this comment.
Tested 3c90de234 on NVIDIA GeForce RTX 3060 (Ampere), driver 621.24 (Vulkan 1.4.357, Vulkan SDK 1.4.363.0), Windows 11 x64, MSVC 19.44.35230.0, CMake + Ninja RelWithDebInfo (no game files): pass (including Khronos validation layer).
- Merges cleanly onto
upstream/main(dfe4e4ad3). - Built
command_list_test,d3d12_uav_clear_test, andd3d12_close_parity_testcleanly with zero new warnings in the modified files. command_list_test.exe: exit 0.d3d12_uav_clear_test.exe(LEONIDA_VK_VALIDATION=1, RTX 3060): exit 0, 0 Vulkan validation errors (ClearUnorderedAccessViewUint/Float: raw, structured and typed buffers and 2D, array and volume textures, whole views and rectangles, all matched).d3d12_close_parity_test.exe(LEONIDA_VK_VALIDATION=1, RTX 3060): exit 0 (113 cases, 78 match WARP, 20 known layer-stricter, 15 known layer-looser, 0 failures).python -I scripts/check_no_game_data.py runtime/src/command_list.h runtime/test/command_list_test.cpp runtime/test/d3d12_uav_clear_test.cpp: clean (exit 0).- Diff review: filtering out non-covering rectangles (
r.left < r.right && r.top < r.bottom) and returning!closed_whenrectswas non-empty butcoveringis empty cleanly treats degenerate/empty rect lists as no-ops without turning them into whole-view clears and without accepting clears on a closed list or invalid view.
AI-assisted.
|
Tested
|
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
|
Tested
So the new test depends on the change. The PR's Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting. |
|
Tested 3c90de2 on NVIDIA GeForce RTX 4080 SUPER, driver 621.24 (Vulkan 1.4.357), Windows 11 Pro 26300, MSVC 14.44, Ninja RelWithDebInfo, applied on
(AI-assisted check, Claude Code.) |
Claim: #8186 (comment)
@ItsNotRexed: an exe PR, as you asked.
What
ClearUnorderedAccessViewUint/ClearUnorderedAccessViewFloatwith a rectangle that covers nothing (inside out:right < leftorbottom < top) no longer fails the command list.CommandList::clear_unordered_access(runtime/src/command_list.h) returnedfalsefor such a rectangle. Ind3d12_com.cppthat marks the list invalid, soCloseanswersE_INVALIDARGand the wholeExecuteCommandListscall is dropped: one degenerate rectangle cost every command in the submission.The recorder now leaves out rectangles that are inside out or empty and records the rest. When no rectangle is left it records no command, because a command without rectangles clears the whole view. The other refusals are unchanged (no resource, an empty buffer range, no layers, a closed list).
Empty rectangles (
right == leftorbottom == top) were already accepted by the recorder and skipped at replay; they are now dropped at the same place as the inside-out ones, so both kinds take one path. One visible difference follows: on a texture that cannot be a colour attachment, a clear whose rectangles are all empty used to reach replay and fail there as unsupported; it is now the no-op D3D12 makes of it.Why
Real D3D12 accepts these calls. Measured on this machine without the debug layer, the same on the NVIDIA device and on WARP:
mainClearUnorderedAccessViewUint, texture view, rect{6,6,2,2}onlyCloseS_OKCloseE_INVALIDARG{4,4,4,8}(empty) onlyCloseS_OKCloseS_OKR32_UINT: whole view = 5, then 9 into{6,6,2,2}, 9 into{4,4,4,8}, 7 into{0,0,2,2}, executed{5,0,2,1}onlyCloseS_OKCloseE_INVALIDARG{5,0,2,1}, 7 into[8,12), executedClearRenderTargetViewwith an inverted rectangle is already accepted by the layer (d3d12_close_parity_test, markedmatch), so the two clears disagreed.Reach: a title gets here by passing a rectangle it clipped to nothing. Whether the retail executable does that is not measured (I did not read the executable, and no report in #7154 names it), but when it happens the cost is a whole frame's submission, not one clear.
Separate from #7105 (argument validation on the COM side; it keeps the
E_INVALIDARGexpectation this PR changes, so the two will conflict on that one test line) and #5170 (rectangle clears on volumes).Tested
Windows 11 (10.0.26200), MSVC 19.42 (VS 2022 Build Tools), RelWithDebInfo, NVIDIA RTX 3080 Ti, driver 616.56, Vulkan SDK 1.4.363.0. No game files.
main@47428cc22'scommand_list.h):command_list_test:line 374: uav.clear_unordered_access(texture_view, false, nine, inside_out), exit 1.d3d12_uav_clear_test:typed buffer, an inside-out rectangle: Close 80070057, replay 0, exit 1.command_list_testexit 0;d3d12_uav_clear_testprints... whole views and rectangles, all matched, exit 0. The new buffer and texture cases are executed on the Vulkan device and read back: the degenerate rectangles write nothing, the rectangle beside them is cleared.command_list_test: a view with no resource, a texture view with no layers, a buffer view with no bytes and any clear on a closed list are still refused; a clear without rectangles is still recorded as a whole-view clear; of{inside out, {0,0,2,2}, empty}exactly{0,0,2,2}is recorded. Ind3d12_uav_clear_testthe three recording-time refusals next to the changed line still answerE_INVALIDARG, and the execution-time refusals (including a real rectangle on a volume) are unchanged.d3d12_close_parity_test(113 cases, 0 failures),d3d12_clear_test,d3d12_short_uav_clear_test,replay_uav_clear_offset_test,d3d12_predicated_copy_test,d3d12_r9g9b9e5_uav_test,d3d12_buffer_uav_test,d3d12_com_test.python -I scripts/check_no_game_data.pyon the three changed files: exit 0.Not tested: AMD or Intel GPUs, Linux/Wine, a volume or a non-attachment format with a degenerate rectangle on the host, and no boot of the title.
AI-assisted (Claude Code).
🤖 Generated with Claude Code