Conor McCarthy : vkd3d-shader: Find bindings for descriptor arrays.
Alexandre Julliard
julliard at winehq.org
Mon Jul 26 15:28:33 CDT 2021
Module: vkd3d
Branch: master
Commit: 2924a481a741f0cdb5891d069b3e23dd4372bb96
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=2924a481a741f0cdb5891d069b3e23dd4372bb96
Author: Conor McCarthy <cmccarthy at codeweavers.com>
Date: Fri Jul 23 23:01:35 2021 +1000
vkd3d-shader: Find bindings for descriptor arrays.
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 511f0c3..8d8b10a 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 3a1a72a..ab29e40 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)
More information about the wine-cvs
mailing list