Repository navigation
Conversation
CreateCommittedResource refused every TEXTURE1D with ALLOW_RENDER_TARGET or
ALLOW_DEPTH_STENCIL ("1D texture cannot be an attachment"), although the PC
runtime creates them: on an RX 6750 XT the AMD adapter and WARP both accept
64 color formats as 1D render targets and 20 as 1D depth-stencils. The 1D
RTV/DSV code already on main was unreachable.
Accepting them also needs a valid attachment view: VulkanBackend::view made
every attachment view VK_IMAGE_VIEW_TYPE_2D_ARRAY, which a VK_IMAGE_TYPE_1D
image can't take (VUID-VkImageViewCreateInfo-subResourceRange-01021). That
already hit rectangle clears of 1D UAV textures on main, whose UAV images
get color-attachment usage. ResourceBinding now records a 1D image, and its
attachment views are 1D arrays. A driver without the 1D attachment image
still refuses through check_image_support.
d3d12_texture1d_target_test compares creation with the host adapter and
WARP, and reads back clears through 1D and 1D-array RTVs and DSVs (whole and
rectangles, mips, slice ranges) and a 1D UAV rectangle clear against WARP.
d3d12_typeless_families_test runs its draws on a 1D target too.
d3d12_vulkan_device_test expected the old refusal.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpgzff6KvVjAnLtc4h
Kam471
left a comment
There was a problem hiding this comment.
Built and ran d3d12_texture1d_target_test at c43942fd on Windows 11, RTX 5070 Ti: exit 0 — 28 1D target descriptions created as the references do, 0 unchecked, 3 clear readbacks compared with WARP, 0 failures (2 references).
1D render targets and depth buffers are now created like the host's, with 1D attachment views, and the typeless/device tests still build. No blocking issue.
|
Tested c43942f on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and on AMD Radeon(TM) Graphics (driver 32.0.21043.5001), Windows 11, MSVC 14.51: pass. The build has no validation layers.
Extra case: I changed the width of the clear test from 5 to 257 texels and moved the color and UAV rectangles to [255, 257). This crosses the 256-texel boundary and covers the last texel. All three readbacks still match WARP on the two GPUs. Negative control: the test object of this head, linked with the D3D12 libraries of the merge base I found no defect. AI-assisted. |
|
Added RTX 3080 committed-attachment coverage at c43942f. All 24 typed descriptions created, and four whole/rectangle color and depth clear cases matched WARP and the CPU reference byte-for-byte. Zero core or synchronization diagnostics. AI-assisted. |
|
Verified Validation & hardware results
AI-assisted (Gemini, Antigravity). |
Claimed in the coordination issue as: new D3D item "1D render targets and depth buffers on the layer", #4257 (comment)
What and why
CreateCommittedResourcerefused everyTEXTURE1DwithALLOW_RENDER_TARGETorALLOW_DEPTH_STENCIL("1D texture cannot be an attachment",runtime/shims/d3d12_vulkan_device.cpp). The PC runtime creates them. A differential sweep on this PC (64-texel 1D textures, formats 1..191) shows the AMD adapter and WARP both accept 64 color formats as 1D render targets and 20 formats as 1D depth-stencils. The layer refused all of them, so theTEXTURE1D/TEXTURE1DARRAYRTV and DSV code already onmain(#1916) could never be reached. Derpbeat noted this on #684.Lifting the refusal alone isn't enough.
VulkanBackend::view(runtime/src/vulkan_backend.h) made every attachment viewVK_IMAGE_VIEW_TYPE_2D_ARRAY, and aVK_IMAGE_TYPE_1Dimage can't take that view type (VUID-VkImageViewCreateInfo-subResourceRange-01021). This already breaks onmain: a 1D UAV texture gets color-attachment usage for rectangle UAV clears, and withLEONIDA_VK_VALIDATION=1its rectangle clear reports that VUID. The fix:ResourceBindinggetsline(a 1D image), andview()gives such imagesVK_IMAGE_VIEW_TYPE_1D_ARRAYattachment views.check_image_support.Tests:
d3d12_texture1d_target_test(registered in CTest, exit 77 without a Vulkan GPU or under Wine). Part 1 covers 10 color formats withALLOW_RENDER_TARGETand 4 depth formats withALLOW_DEPTH_STENCIL, each as one texture and as a 6-layer array with a full mip chain. Wherever the host adapter and WARP both create one and the Vulkan device can make that 1D attachment image, the layer must create it, andGetResourceAllocationInfomust return a size. Part 2 runs clears and reads every subresource back against WARP, byte for byte: throughTEXTURE1DandTEXTURE1DARRAYRTVs (seeded per subresource, a whole clear of one mip, rectangle clears on a slice range and onArraySize = -1), through DSVs (whole and a rectangle), and a rectangle clear through a 1D UAV. Clear values avoid UNORM 0.5 ties, so NVIDIA's tie rounding can't cause a mismatch. A device without a 1D D32 depth attachment skips the depth clears.d3d12_typeless_families_testnow runs its 8 host-compared draws (GLSL stand-ins vs HLSL on the host) on a 4-texel 1D target as well as on the 4x4 2D one.d3d12_vulkan_device_testexpected the old refusal of a 1D render target. It now expects the texture to be created.Tested
AMD Radeon RX 6750 XT (RDNA2), AMD driver 26.11.2, Vulkan 1.4.315, Windows 11 26300, MSVC 14.44, Vulkan SDK 1.4.363.0. "Before" means clean
main03b09a0 with only the test changes applied (a separate worktree). "After" means this branch (head c43942f, based on 03b09a0).d3d12_texture1d_target_testLEONIDA_VK_VALIDATION=1, 0 messages)d3d12_typeless_families_testd3d12_vulkan_device_testctest --test-dir runtime/build -j 4scripts/run_gpu_tests.py(default)LEONIDA_VK_VALIDATION=1(texture1d, uav_clear, short_uav_clear, typeless_rtv, clear, resource_desc, draw, msaa_draw, m3_frame, subresource_copy, depth_resolve)python -m compileall -q make_game.py tools tests scriptsNot tested: other vendors' GPUs (NVIDIA, Intel, Apple/MoltenVK), Linux/RADV, and a device that lacks 1D depth attachments. On such a device the depth clears skip and the creation check counts those formats as "not checked". Draws into a 1D depth buffer and MSAA aren't covered (D3D12 has no multisampled 1D textures). Placed 1D textures aren't covered either (#3351).
Notes:
MipLevelsexceeds the full chain:CreateCommittedResourcefor a 64x1 1D texture with 16 mips, andGetResourceAllocationInfofor 2D and 3D ones. WARP returned normally for the same calls. This is a host driver issue, not part of this PR.ALLOW_UNORDERED_ACCESS,GetResourceAllocationInfoflag checks,CreateReservedResourcebuffers withALLOW_CROSS_ADAPTER). They will be posted asfinding:lines, not fixed here.Checklist
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)AI-assisted (Claude Code, Opus). The test results above are from real runs on the hardware listed.
🤖 Generated with Claude Code
https://claude.ai/code/session_015z45kpgzff6KvVjAnLtc4h