[PATCH vkd3d v3 1/5] vkd3d-shader: Find bindings for descriptor arrays.

Conor McCarthy cmccarthy at codeweavers.com
Fri Jul 23 08:01:35 CDT 2021


Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 libs/vkd3d-shader/spirv.c | 13 +++----------
 tests/d3d12.c             |  1 +
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 33e664cf..3a486d50 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2468,6 +2468,7 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor
         bool is_uav_counter)
 {
     const struct vkd3d_shader_interface_info *shader_interface = &compiler->shader_interface;
+    unsigned int register_last = (range->last == ~0u) ? range->first : range->last;
     enum vkd3d_shader_descriptor_type descriptor_type;
     enum vkd3d_shader_binding_flag resource_type_flag;
     struct vkd3d_shader_descriptor_binding binding;
@@ -2543,18 +2544,10 @@ static struct vkd3d_shader_descriptor_binding vkd3d_dxbc_compiler_get_descriptor
                 continue;
 
             if (current->type != descriptor_type || current->register_space != range->space
-                    || current->register_index != range->first)
+                    || current->register_index > range->first
+                    || current->binding.count <= register_last - current->register_index)
                 continue;
 
-            if (current->binding.count != 1)
-            {
-                FIXME("Descriptor arrays are not supported.\n");
-                vkd3d_dxbc_compiler_error(compiler, VKD3D_SHADER_ERROR_SPV_INVALID_DESCRIPTOR_BINDING,
-                        "Descriptor binding for type %#x, space %u, register %u, "
-                        "shader type %#x has unsupported ‘count’ %u.",
-                        descriptor_type, range->space, range->first, compiler->shader_type, current->binding.count);
-            }
-
             return current->binding;
         }
         if (shader_interface->binding_count)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 3a1a72a8..ab29e405 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -34624,6 +34624,7 @@ static void test_resource_arrays(void)
                 get_cpu_descriptor_handle(&context, heap, ARRAY_SIZE(input_buffers) + i));
     }
 
+    todo
     context.pipeline_state = create_compute_pipeline_state(device, context.root_signature,
             shader_bytecode(cs_code, sizeof(cs_code)));
     if (!context.pipeline_state)
-- 
2.32.0




More information about the wine-devel mailing list