From 409da28db73dd249c24c4aba175a33369ebbcc7b Mon Sep 17 00:00:00 2001 From: Xeda-Development Date: Thu, 26 Nov 2026 13:14:30 +0200 Subject: [PATCH] d3d12_texture_uav_test: fill the tagged descriptor table for its bare .spv (GPU-TEXTURE-UAV-1D-REGRESSION) Since 9f98dcc61 the translator's default is --descriptor-table tagged: a module reads the kind word next to each index and takes the array's fallback when its T# is not marked as bound there. The device fills that word only when a shader library's index says a module reads it; with no library it uses the plain layout. This test hands the device one .spv and no library, so every store of cs_texture_uav landed on the fallback and the first GPU case read back its seed (got 0x11, expected 0x3f9). The kind word is additive and a plain module never reads it, so the test asks for the tagged table unless LEONIDA_DESCRIPTOR_TABLE is set. Co-Authored-By: Claude Mythos 5.2 --- runtime/test/d3d12_texture_uav_test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtime/test/d3d12_texture_uav_test.cpp b/runtime/test/d3d12_texture_uav_test.cpp index d6774438ea..8d8606d728 100644 --- a/runtime/test/d3d12_texture_uav_test.cpp +++ b/runtime/test/d3d12_texture_uav_test.cpp @@ -685,6 +685,17 @@ int main(int argc, char** argv) { } if (status != vktest::DeviceStatus::ready) return 1; const char* shader = std::strcmp(argv[1], "--descriptors-only") == 0 ? nullptr : argv[1]; + // The module arrives as a bare .spv, with no shader library whose index would tell the device which descriptor + // table layout it reads, and without one the device fills the plain layout: no kind word. A module from the + // translator's default (--descriptor-table tagged) then finds no array its T# is bound in and every store lands on + // the fallback. The kind word is additive, a plain module never reads it, so the tagged table suits either + // translation; LEONIDA_DESCRIPTOR_TABLE, when set, still decides. + if (shader) { + char layout[2]{}; + std::size_t layout_size = 0; + if (getenv_s(&layout_size, layout, sizeof(layout), "LEONIDA_DESCRIPTOR_TABLE") == 0 && layout_size == 0) + _putenv_s("LEONIDA_DESCRIPTOR_TABLE", "tagged"); + } VkPhysicalDeviceProperties props{}; vk.instance_fn("vkGetPhysicalDeviceProperties")(vk.physical, &props); if (!vk.bindless || !vk.robust_image_access || (shader && props.limits.maxPushConstantsSize < push_bytes())) {