Repository navigation
d3d12: sRGB and depth-only textures with unordered access created as the host does (D3D-466) - #4493
martingouv wants to merge 2 commits into
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_vulkan_device_test at 8c51f567 on Windows 11, RTX 5070 Ti: exit 0; the full device suite passes, including the sRGB/depth-only UAV cases and the placed castable-format comparison. No blocking issue.
|
Code read at 8c51f56 (not built). One path the new differential test doesn't reach:
As far as I can tell from the code, No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
|
Reading review (no Windows/Vulkan-on-Windows here): the reasoning is sound and the change is narrowly scoped.
Cannot run the Windows test. No game data. AI-assisted. |
|
Verified Hardware & validation results (standard and
|
|
AI-assisted Windows hardware verification for D3D-466 on AMD Radeon RX 6750 XT (
|
|
Merges cleanly into main 3faac55; compileall clean, the three docs guards over d3d12_vulkan.md green, and nothing on main mentions D3D-466 (no supersession). The format logic reads consistently — the same texture_format() gates both CreateCommittedResource and GetResourceAllocationInfo, D32_FLOAT/D16_UNORM keep UAV while the sRGB and D24/D32S8 pair lose storage usage exactly as the doc row claims. Two concerns: the branch reports no CI checks at all, and the new 38-line case is gated on a host D3D12 device — on Linux it prints skipped, so right now nothing executes it. A push to trigger CI plus one Linux-reachable assertion would fix the coverage hole. One question: should CreateUnorderedAccessView on such a resource now be refused up front, since the only remaining signal is the later vkCreateImageView failure (note_storage_image is bookkeeping, not a usage upgrade)? AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
A gap I hit while rebasing #4581, which carries this PR's commit. This PR's test doesn't cover it. On an RX 9060 XT (AMD Software 26.11.2), a typed
A possible fix, the one #4581 uses for B8G8R8X8: when an image gets storage usage its own format can't take, add This is the layer's side only. I haven't measured what the host runtime answers for this texture, or what a store through the UNORM view writes. AI-assisted (Claude Code). No game data. |
…the host does (D3D-466) Typed R8G8B8A8_UNORM_SRGB, B8G8R8A8_UNORM_SRGB, D32_FLOAT and D16_UNORM have no UAV view in D3D12 without a castable-format list, so their UAV-flagged images no longer get VK_IMAGE_USAGE_STORAGE_BIT, which these Vulkan formats lack. The host creates them; the layer refused them (sRGB on NVIDIA, all four on AMD). The test this adds also showed what the storage bit had been refusing by chance: the host refuses unordered access on D24_UNORM_S8_UINT and D32_FLOAT_S8X24_UINT, and any volume texture in a depth format (with or without flags). Both are now refused explicitly, in creation and GetResourceAllocationInfo alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GetResourceAllocationInfo refuses ALLOW_DEPTH_STENCIL with ALLOW_UNORDERED_ACCESS, as creation does and the host answers (paratustra): with D32_FLOAT/D16_UNORM no longer asking for storage usage, nothing else refused the pair. - CreateUnorderedAccessView refuses a view whose format is a typed sRGB or depth one, as it does for B8G8R8X8 (memorypressure). - The host comparison adds the DEPTH_STENCIL | UNORDERED_ACCESS flags, and the answers are also pinned without a host device, so Linux and Wine run them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8c51f56 to
c0e3b80
Compare
|
Thanks all. Rebased on
Thanks @Kam471, @itsonlysimbo, @justr4mzi and @Alpaca-exe for the runs. The two AMD ones cover what I couldn't test. Re-tested AI-assisted (Claude Code). |
|
Independent native Windows check of c0e3b808. RTX 3080 Ti, NVIDIA 621.35, Vulkan SDK 1.4.363.0. The focused The adapter reported no optimal-tiling storage support for either sRGB format. This run covered creation and allocation queries, without a castable UAV write. AI-assisted. |
D3D-466 (listed in #313; claimed in #4421 (comment)). Found by @gabsilvs in #4257 (comment).
What was wrong
TextureCreateInfo(runtime/shims/d3d12_vulkan_device.cpp) gave every texture withALLOW_UNORDERED_ACCESSVK_IMAGE_USAGE_STORAGE_BIT. For typedR8G8B8A8_UNORM_SRGB,B8G8R8A8_UNORM_SRGB,D32_FLOATandD16_UNORMthe Vulkan format may have no storage feature, socheck_image_supportrefused a texture the host creates. D3D12 has no UAV view in these formats, and without a castable-format list no view leaves the resource's format, so the image never needs storage usage.The change
texture_format, so creation andGetResourceAllocationInfoagree with the host on every driver:D24_UNORM_S8_UINTandD32_FLOAT_S8X24_UINT(the host refuses it);D32_FLOAT/D16_UNORM/... 3D textures before).docs/d3d12_vulkan.md: one bullet next to theB8G8R8X8(D3D-87) one.Test
d3d12_vulkan_device_testgets a host comparison next to D3D-87's: 6 formats (the four above plus D24S8 and D32S8) x 1D/2D/3D x {no flags,ALLOW_UNORDERED_ACCESS}, comparingCreateCommittedResourcesuccess and whetherGetResourceAllocationInfogives a size. All mismatches are printed before the test fails.LEONIDA_HOST_ADAPTER=warp).ctest --test-dir runtime/build: 147 of 147 pass (10 skipped/disabled that need game files or other hardware).Tested on Windows 11 (10.0.26200), NVIDIA GeForce RTX 5060 Ti, driver 621.24, MSVC 2022 Build Tools, Vulkan SDK 1.4.363. Not tested on AMD, where the finding saw
D32_FLOAT/D16_UNORMrefused too; a check there is welcome.AI-assisted (Claude Code).
🤖 Generated with Claude Code