Mesa (main): zink: introduce a define for max descriptors per type
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 13:15:55 UTC 2021
Module: Mesa
Branch: main
Commit: 4439f500a2c51aa25774021699b0cdbc4ae906f4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4439f500a2c51aa25774021699b0cdbc4ae906f4
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Tue Jun 15 08:25:34 2021 -0700
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 at gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11380>
---
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;
More information about the mesa-commit
mailing list