upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorgabsilvs <142851434+gabsilvs@users.noreply.github.com>2026-11-22 22:30:25 -0300
committergabsilvs <142851434+gabsilvs@users.noreply.github.com>2026-11-22 22:30:25 -0300
commitc43942fddfe9b2ec3be98f1dd4fee6ebdac06503 (patch)
tree18271d1a7bf85d19b59caba91ef18362a6916740 /runtime/src
parent03b09a086592a197db64d91655c6e65c30764d96 (diff)
d3d12: 1D render targets and depth buffers
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
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/vulkan_backend.h2
-rw-r--r--runtime/src/vulkan_replay.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h
index 03ab7ba26..720842003 100644
--- a/runtime/src/vulkan_backend.h
+++ b/runtime/src/vulkan_backend.h
@@ -1310,7 +1310,7 @@ private:
1310 if (const auto it = views_.find(key); it != views_.end()) return it->second; 1310 if (const auto it = views_.find(key); it != views_.end()) return it->second;
1311 VkImageViewCreateInfo info{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; 1311 VkImageViewCreateInfo info{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO};
1312 info.image = r.image; 1312 info.image = r.image;
1313 info.viewType = VK_IMAGE_VIEW_TYPE_2D_ARRAY; 1313 info.viewType = r.line ? VK_IMAGE_VIEW_TYPE_1D_ARRAY : VK_IMAGE_VIEW_TYPE_2D_ARRAY; // 1D images take no 2D view
1314 info.format = r.format; 1314 info.format = r.format;
1315 info.subresourceRange = range; 1315 info.subresourceRange = range;
1316 // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended 1316 // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended
diff --git a/runtime/src/vulkan_replay.h b/runtime/src/vulkan_replay.h
index 4185d6ff8..1cf491a07 100644
--- a/runtime/src/vulkan_replay.h
+++ b/runtime/src/vulkan_replay.h
@@ -75,6 +75,7 @@ struct ResourceBinding {
75 std::uint64_t va = 0; // a buffer's console VA (GetGPUVirtualAddress), for vertex/index views 75 std::uint64_t va = 0; // a buffer's console VA (GetGPUVirtualAddress), for vertex/index views
76 std::uint32_t depth = 1; 76 std::uint32_t depth = 1;
77 bool volume = false; // one array layer, including at mips with a single slice 77 bool volume = false; // one array layer, including at mips with a single slice
78 bool line = false; // a 1D image (TEXTURE1D): its attachment views are 1D arrays
78 std::uint32_t samples = 1; // more than one: a multisampled 2D texture 79 std::uint32_t samples = 1; // more than one: a multisampled 2D texture
79 bool typeless = false; // A TYPELESS color resource: views name a format of its family (D3D-275). 80 bool typeless = false; // A TYPELESS color resource: views name a format of its family (D3D-275).
80 bool castable_view_formats = false; // A creation-time castable list made the image mutable (D3D-85/D3D-90), 81 bool castable_view_formats = false; // A creation-time castable list made the image mutable (D3D-85/D3D-90),