mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
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:
parent
1082dc5f4a
commit
402eaa0795
2 changed files with 3 additions and 0 deletions
|
|
@ -921,6 +921,8 @@ zink_shader_create(struct zink_screen *screen, struct nir_shader *nir,
|
||||||
assert(var->data.mode == nir_var_uniform);
|
assert(var->data.mode == nir_var_uniform);
|
||||||
if (glsl_type_is_sampler(type) || glsl_type_is_image(type)) {
|
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);
|
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);
|
ztype = zink_desc_type_from_vktype(vktype);
|
||||||
var->data.descriptor_set = ztype;
|
var->data.descriptor_set = ztype;
|
||||||
var->data.driver_location = var->data.binding;
|
var->data.driver_location = var->data.binding;
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ struct zink_shader {
|
||||||
unsigned char size;
|
unsigned char size;
|
||||||
} bindings[ZINK_DESCRIPTOR_TYPES][32];
|
} bindings[ZINK_DESCRIPTOR_TYPES][32];
|
||||||
size_t num_bindings[ZINK_DESCRIPTOR_TYPES];
|
size_t num_bindings[ZINK_DESCRIPTOR_TYPES];
|
||||||
|
unsigned num_texel_buffers;
|
||||||
uint32_t ubos_used; // bitfield of which ubo indices are used
|
uint32_t ubos_used; // bitfield of which ubo indices are used
|
||||||
uint32_t ssbos_used; // bitfield of which ssbo indices are used
|
uint32_t ssbos_used; // bitfield of which ssbo indices are used
|
||||||
struct set *programs;
|
struct set *programs;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue