Repository navigation
Conversation
…tes anything A null ppvResource makes CreateCommittedResource/1/2/3 a capability check: the host runtime (RX 5700) answers S_FALSE for a valid description whatever the riid, even for a UINT64_MAX-byte buffer or an 8 TiB texture, and the refusal for an invalid one. create_committed built the resource and released it, so the check failed with E_OUTOFMEMORY for a full GPU address arena, a buffer larger than the arena or a texture larger than any memory heap. It now makes every argument check first, the Vulkan device's answer for the image and its castable list included (prepare_image, shared by create_texture and Resource::texture_supported), and returns S_FALSE before it creates anything; with an output nothing changes. CreatePlacedResource2 and CreateReservedResource2, which answer a null output with E_UNEXPECTED as the host does, now check their castable-format list before that answer, since the host refuses a bad list without an output too. d3d12_method_variants_test and d3d12_vulkan_device_test compare the null-output answers with the host live and check the no-room cases on devices with and without the arena. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent NVIDIA check at |
|
AMD check at
A scratch native D3D12 probe (not committed) on both adapters gives the same answers you measured on the RX 5700:
So the host behaviour is the same on RDNA1, RDNA2 and RDNA4 AMD drivers. Synthetic inputs only. AI-assisted. |
|
Tested 055118f on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
Claimed in the coordination issue as: #5256 (comment)
What and why
A null
ppvResourcemakesCreateCommittedResourceandCreateCommittedResource1/2/3a capability check. I measured the host runtime on an RX 5700:S_FALSE, whatever theriid, and nothing is created;S_FALSEeven where creation could never succeed: aUINT64_MAX-byte buffer (E_OUTOFMEMORYwith an output), default-heap buffers of 4 GiB, 64 GiB and 1 TiB, a 64 GiB upload buffer, and an 8 TiB texture.The layer's
create_committedbuilt the resource first (an arena range, or aVkBufferorVkImageand its memory), then released it and returnedS_FALSE. So the check failed wherever creation fails for lack of room:E_OUTOFMEMORYwith a full GPU address arena, for a default-heap buffer larger than the arena, or for a texture larger than any memory heap;E_INVALIDARGfor a buffer within 64 KiB ofUINT64_MAX.create_committednow makes every argument check first, and returnsS_FALSEfor a null output before it creates or allocates anything. That includes the Vulkan device's answer for a texture's image with its castable-format list. The image setup moves out ofcreate_textureintoprepare_image, whichcreate_textureand a newResource::texture_supportedshare, so both ask the device the same question. With an output, nothing changes.CreatePlacedResource/1/2andCreateReservedResource/1/2were audited for the same problem:E_UNEXPECTED, notS_FALSE, for a valid description and a wrongriidalike, and the layer already gave it;CreatePlacedResource2andCreateReservedResource2checked their castable-format list only after thatE_UNEXPECTED. The host refuses a format of another texel size,UNKNOWN, or a list on a buffer withE_INVALIDARGwithout an output too. Both now check the list first, and answers with an output are unchanged.CreateHeapis untouched: #1846 makes the same fix there. The two PRs change no adjacent lines and merge cleanly.docs/d3d12_vulkan.mdhas the rules and the test descriptions. This branch is based onmain3faac55 and merges cleanly withmain561b65a.Tested
Windows 11, AMD Radeon RX 5700, AMD driver 32.0.21045.29003, MSVC 14.44, Vulkan SDK 1.4.363.1.
riid=ID3D12Fence. It gave the answers above, which the new tests compare with the host live.d3d12_method_variants_test:CreateCommittedResource1/2/3,CreatePlacedResource1/2andCreateReservedResource1/2(valid, invalid, castable lists, wrong interface), compared with the host runtime live;check_no_room: an 8 TiB texture on a device without the GPU address arena and on one with it, and a 4 GiB default-heap buffer (larger than any arena), through all four committed variants. With an output each givesE_OUTOFMEMORYwith nothing handed out; without one,S_FALSE, matching the host's ownS_FALSE;compare_creationnow requires every creation case's null-output answer to beS_FALSEwhere creation succeeds and its refusal where creation fails. A newD32_FLOATrender-target case is one the Vulkan device refuses.d3d12_vulkan_device_test: all against the host.compare_invalid_arguments: wrong interface, a render target with a clear value, a plain texture with one, a texture on an upload heap, 4x MSAA without RT or DS, and aUINT64_MAX-byte buffer;compare_placed_reserved: wrong interface, placed and reserved.create_committedfails all 12check_no_roomrows (E_OUTOFMEMORYwithout an output) and theUINT64_MAXcase (E_INVALIDARG, hostS_FALSE);create_placedandcreate_reservedeach fail their castable null-output case (E_UNEXPECTED, hostE_INVALIDARG);texture_supported, as this driver accepted all 16 lists tried.d3d12_method_variantsandd3d12_vulkan_devicepass, andd3d12_method_variantspasses underLEONIDA_VK_VALIDATION=1with no validation messages.cmake --build <build> --parallel 6, thenctest -j 2 -E "d3d12_present|vk_presenter_sync|xbox_present": 175 tests, 166 passed, 9 skipped, 0 failed.AI-assisted: yes (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (N/A: no translator change.)🤖 Generated with Claude Code