From 4439f500a2c51aa25774021699b0cdbc4ae906f4 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 15 Jun 2021 08:25:34 -0700 Subject: [PATCH] zink: introduce a define for max descriptors per type We know what this max is in the compiler, let's move that out into zink_descriptors.h, so we can reuse the constant. Reviewed-by: Hoe Hao Cheng Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_compiler.h | 2 +- src/gallium/drivers/zink/zink_descriptors.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_compiler.h b/src/gallium/drivers/zink/zink_compiler.h index 844aee95d05..7191f3a8412 100644 --- a/src/gallium/drivers/zink/zink_compiler.h +++ b/src/gallium/drivers/zink/zink_compiler.h @@ -78,7 +78,7 @@ struct zink_shader { int binding; VkDescriptorType type; unsigned char size; - } bindings[ZINK_DESCRIPTOR_TYPES][32]; + } bindings[ZINK_DESCRIPTOR_TYPES][ZINK_MAX_DESCRIPTORS_PER_TYPE]; size_t num_bindings[ZINK_DESCRIPTOR_TYPES]; unsigned num_texel_buffers; uint32_t ubos_used; // bitfield of which ubo indices are used diff --git a/src/gallium/drivers/zink/zink_descriptors.h b/src/gallium/drivers/zink/zink_descriptors.h index fb9ca5878dc..cd5d40a0427 100644 --- a/src/gallium/drivers/zink/zink_descriptors.h +++ b/src/gallium/drivers/zink/zink_descriptors.h @@ -45,6 +45,7 @@ enum zink_descriptor_type { ZINK_DESCRIPTOR_TYPES, }; +#define ZINK_MAX_DESCRIPTORS_PER_TYPE 32 struct zink_descriptor_refs { struct util_dynarray refs;