Repository navigation
Conversation
…ead of dropping the list ResolveSubresourceRegion recorded a region that ran past the destination's width or height, and replay refused it at Execute, so Close said S_OK and the whole list (clears recorded before the resolve included) was lost without a word. The host runtime and WARP fail Close with E_INVALIDARG when DstX/DstY plus the region (pSrcRect, or the whole source) exceeds the destination's top level. The region is now checked when it is recorded. d3d12_resolve_region_clip_test resolves a 4x MSAA 4x4 source into a 4x4 destination on the Vulkan device and on the host (and WARP), comparing Close and the bytes: 3 of 5 cases differ on main, 0 with the fix. AI-assisted: yes
al3xar
left a comment
There was a problem hiding this comment.
Independent Windows + GPU + Vulkan validation verification of c335fbf4e (AI-assisted).
- Environment: Windows 11 x64, MSVC 19.44.35230.0 (Ninja Release), Windows SDK 10.0.26100.0, NVIDIA GeForce RTX 3060 (driver
621.24), Vulkan SDK1.4.363.0(LEONIDA_VK_VALIDATION=1), no game files. - Test runs (
LEONIDA_VK_VALIDATION=1):- Against NVIDIA RTX 3060 host:
d3d12_resolve_region_clip_test→ PASS (resolve region clip: 0 of 5 cases differ, exit 0, 0 Vulkan validation errors). - Against WARP (
PROBE_WARP=1):d3d12_resolve_region_clip_test→ PASS (resolve region clip: 0 of 5 cases differ, exit 0, 0 Vulkan validation errors).
- Against NVIDIA RTX 3060 host:
- Negative control: Reverted
runtime/shims/d3d12_com.cpptoupstream/main(6312c057f) and re-rand3d12_resolve_region_clip_test→ FAIL (resolve region clip: 3 of 5 cases differ, exit 1). - Code review:
- Recording-time bounds check in
ResolveSubresourceRegionuses 64-bit addition (x + w > dst_desc.Width || y + h > dst_desc.Height) and cleanly matches both host and WARPClose() -> E_INVALIDARG. - Minor non-blocking notes: widening
INT64(rect->right) - INT64(rect->left)would avoid signed 32-bit overflow on extreme negative/positiveLONGbounds;std::getenv("PROBE_WARP")atd3d12_resolve_region_clip_test.cpp:151emits MSVCC4996.
- Recording-time bounds check in
LGTM.
|
Tested
Nit: AI-assisted (Claude Code). No game files. |
|
Tested on AMD Radeon RX 7700 XT (RDNA3), AMD Windows driver 32.0.32029.2010, Windows 11, MSVC 14.51 Release, at c335fbf. Full No regression from this PR. The new AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
|
AI-assisted test. Pass, and the host on this GPU agrees. Tested
|
|
Under Wine, both
AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue: #9065 (comment)
What and why
ResolveSubresourceRegion(runtime/shims/d3d12_com.cpp) recorded a region that runs past the destination's width or height without checking it. Replay then refused it (prepare_resolveinruntime/src/vulkan_replay.hreturnsinvalid_copy), soClosereturned S_OK, and atExecuteCommandListsevery command in the list was lost without any error reaching the app. That includes clears recorded before the resolve.The host runtime and WARP both fail
Closewith E_INVALIDARG when DstX/DstY plus the region size (pSrcRect, or the whole source when it is null) is larger than the destination's top-level Width/Height. The region is now checked when it is recorded, the same way.4x MSAA 4x4 RGBA8 source, 4x4 RGBA8 destination:
#8542 adds the same recording-time check for
ResolveSubresource; it leavesResolveSubresourceRegionalone.Tested
Windows 11, RTX 5070 Ti (NVIDIA 621.14), MSVC 14.44, RelWithDebInfo, main 6312c05. No game files.
d3d12_resolve_region_clip_testrecords the same clears and resolves on the Vulkan device and on the host device, then compares theCloseresult and the destination bytes.d3d12_resolve_region_clip_warpruns it against WARP. It skips (77) if a device is missing.resolve region clip: 3 of 5 cases differ, exit 1, against both the host and WARP.0 of 5 cases differ, exit 0, against both.ctest -R "resolve_region_clip|close_parity|d3d12_clear$": 4/4 pass.d3d12_vulkan_deviceandd3d12_depth_resolvefail the same way with or without this change; both are already known on main.LEONIDA_VK_VALIDATION=1run.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (n/a, no translator change)