Repository navigation
d3d12: A8_UNORM textures in 1D and 3D, as the host runtime makes them - #9336
tibzejoker wants to merge 2 commits into
Conversation
The layer accepted A8_UNORM only as a single-sampled 2D texture. The host runtime reports TEXTURE1D, TEXTURE2D and TEXTURE3D for it and sizes and creates all three (RTX 4090 617.42 and WARP). The retail title sizes a 1D 128-texel A8_UNORM texture through device slot 25, got UINT64_MAX and stopped on its 32-bit size check. 1D and 3D A8 textures now take the same path as 2D: an R8 image read through the alpha swizzle, which does not depend on the dimension. Format support reports the three dimension bits. Render targets, depth and UAVs stay refused. d3d12_a8_dimensions_test compares format support, sizes and alignments with the host adapter and WARP (1D, 1D array, 2D, 3D, with and without the 4 KiB alignment) and round-trips a byte pattern through every subresource. Without the fix it fails 12 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent Linux CPU review
Checked: A8_UNORM textures allowed in 1D/3D as on host; docs + d3d12_a8_dimensions_test + CMake. Windows/D3D12 harness not run here.
Looks correct from review; no game files.
|
Retail check on i9-13900K + RTX 4090 (617.42), own 1.0.2.1 copy,
AI-assisted (Claude Code). |
|
Tested c31e639 (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11 (build 26200), Vulkan validation layer on (
Ran the tests that belong to the test files this PR changes (ctest entries, or the test program directly when it is not registered), with no game files ( |
|
Tested c31e639 on RTX 4070 SUPER, NVIDIA 621.01, Windows 11 Pro: pass
|
|
Tested
AI-assisted (Claude Code). Synthetic test only, no game files. |
…say alignments, not sizes, are compared From review on ItsNotRexed#9336 (@ikurta92-png): the test counted no validation errors, and the docs said it compared sizes where it compares only that each description is sized, with WARP's alignment. The sizes stay unpinned: the host adapter and WARP differ on some small-alignment ones (1D 300 x3 mips at 4 KiB: 8192 vs 4096). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ikurta92-png thanks, both points were right.
@egexon @YordiLorenzo thanks for the RTX 5070 and 4070 SUPER runs. AI-assisted (Claude Code). |
|
Tested f97ea2a on NVIDIA GeForce RTX 4080 SUPER, driver 621.24 (Vulkan 1.4.357), Windows 11 Pro 26300, MSVC 14.44, Ninja RelWithDebInfo (fresh build folder), applied on
Overlap: #7755 by @NiiRoZz (open, mergeable, head 952be9b) has the same title and edits the same four files, down to the same new test name (AI-assisted check, Claude Code.) |
Claimed in the coordination issue: #9235 (comment)
What was wrong
texture_formatacceptedA8_UNORMonly as a single-sampled 2D texture. The host runtime makes it in all three dimensions. Measured with a stand-alone D3D12 program on an RTX 4090 (617.42) and on WARP:CheckFeatureSupport(FORMAT_SUPPORT)reports TEXTURE1D, TEXTURE2D and TEXTURE3D forA8_UNORMon both.GetResourceAllocationInfoanswers 64 KiB in every dimension, or 4 KiB when the description asks for the 4 KiB alignment, andCreateCommittedResourcesucceeds.The retail title sizes a 1D 128-texel
A8_UNORMtexture through device slot 25, with Alignment 4096 and then 0. I measured it with a temporary log on slot 25, on my integration branch, which carries #7679 and #7009. The layer answeredUINT64_MAXto both, and the title stopped on its check that the size fits in 32 bits (int3 at+0x344196, the same check #7679 hit with its depth texture).The change
A8_UNORMtextures now take the 2D path: an R8 image read through the (0, 0, 0, A) swizzle inimage_descriptor. That swizzle depends only on the resource format, not the dimension.docs/d3d12_vulkan.mddescribes the three dimensions.Tested
On an RTX 4090 (617.42), Windows 11 26200, MSVC 2022 RelWithDebInfo, with
LEONIDA_VK_VALIDATION=1and no validation errors.New
d3d12_a8_dimensions_test:Other tests on the same build:
d3d12_descriptor(the existing 2D A8 sampling checks),d3d12_texture1d_target,d3d12_placed_dimensions,d3d12_subresource_copy,d3d12_clear_formats,device_proxyandxs_proxy_mock.d3d12_vulkan_devicefails, but it fails onmain867d922 as well, with output identical line for line to this branch's.Synthetic only, no game data. The retail result with this change on my integration branch will follow as a comment.
AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code