zink: fix ZINK_MAX_DESCRIPTORS_PER_TYPE to stop exploding the stack
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 13 Sep 2021 11:49:54 +0000 (07:49 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Sep 2021 17:46:11 +0000 (17:46 +0000)
this isn't the max per type, it's the max that can be used for a type,
which is the max used by a shader stage * the number of shader stages

Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12829>

src/gallium/drivers/zink/zink_descriptors.h

index 1b19b8b..a2b56da 100644 (file)
@@ -48,7 +48,7 @@ enum zink_descriptor_type {
    ZINK_DESCRIPTOR_TYPES,
 };
 
-#define ZINK_MAX_DESCRIPTORS_PER_TYPE 32
+#define ZINK_MAX_DESCRIPTORS_PER_TYPE (32 * ZINK_SHADER_COUNT)
 
 struct zink_descriptor_refs {
    struct util_dynarray refs;