zink: track number of tbos in shader data

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10699>
This commit is contained in:
Mike Blumenkrantz
2021-04-01 14:21:34 -04:00
parent 1082dc5f4a
commit 402eaa0795
2 changed files with 3 additions and 0 deletions

View File

@@ -921,6 +921,8 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
assert(var->data.mode == nir_var_uniform);
if (glsl_type_is_sampler(type) || glsl_type_is_image(type)) {
VkDescriptorType vktype = glsl_type_is_image(type) ? zink_image_type(type) : zink_sampler_type(type);
if (vktype == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER)
ret->num_texel_buffers++;
ztype = zink_desc_type_from_vktype(vktype);
var->data.descriptor_set = ztype;
var->data.driver_location = var->data.binding;

View File

@@ -78,6 +78,7 @@ struct zink_shader {
unsigned char size;
} bindings[ZINK_DESCRIPTOR_TYPES][32];
size_t num_bindings[ZINK_DESCRIPTOR_TYPES];
unsigned num_texel_buffers;
uint32_t ubos_used; // bitfield of which ubo indices are used
uint32_t ssbos_used; // bitfield of which ssbo indices are used
struct set *programs;