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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15853>
This commit is contained in:
Mike Blumenkrantz
2022-04-11 15:07:11 -04:00
committed by Marge Bot
parent c7ae22e4b8
commit 23c758807e

View File

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