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 <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
This commit is contained in:
Erik Faye-Lund 2021-06-15 08:25:34 -07:00 committed by Marge Bot
parent 0ee48216dd
commit 4439f500a2
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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;