From 23c758807e76183cd2dbd5ee97f296bde167c93b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 11 Apr 2022 15:07:11 -0400 Subject: [PATCH] zink: handle 0 ubos and 0 ssbos in pipeline layout this is the number of types needed, and it can be zero cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_descriptors_lazy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_descriptors_lazy.c b/src/gallium/drivers/zink/zink_descriptors_lazy.c index 83bac2d5739..9fc3f052d8f 100644 --- a/src/gallium/drivers/zink/zink_descriptors_lazy.c +++ b/src/gallium/drivers/zink/zink_descriptors_lazy.c @@ -132,12 +132,12 @@ descriptor_program_num_sizes(VkDescriptorPoolSize *sizes, enum zink_descriptor_t { switch (type) { case ZINK_DESCRIPTOR_TYPE_UBO: - return 1; + return !!sizes[ZDS_INDEX_UBO].descriptorCount; case ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW: return !!sizes[ZDS_INDEX_COMBINED_SAMPLER].descriptorCount + !!sizes[ZDS_INDEX_UNIFORM_TEXELS].descriptorCount; case ZINK_DESCRIPTOR_TYPE_SSBO: - return 1; + return !!sizes[ZDS_INDEX_STORAGE_BUFFER].descriptorCount; case ZINK_DESCRIPTOR_TYPE_IMAGE: return !!sizes[ZDS_INDEX_STORAGE_IMAGE].descriptorCount + !!sizes[ZDS_INDEX_STORAGE_TEXELS].descriptorCount;