Repository navigation
d3d12: sRGB and depth-only textures with unordered access created as the host does (D3D-466) - #4493
martingouv wants to merge 1 commit into
Conversation
…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>
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 (
|
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