enum glsl_base_type base_type =
glsl_get_base_type(glsl_without_array(type));
unsigned aoa_size = MAX2(1, glsl_get_aoa_size(type));
+ unsigned loc = variable->data.location;
+ int slot_count = glsl_count_attribute_slots(type, false);
+ int max_slot = MAX2(info->const_file_max[0], (int) loc) + slot_count;
/* Gather buffers declared bitmasks. Note: radeonsi doesn't
* really use the mask (other than ubo_idx == 1 for regular
if (base_type == GLSL_TYPE_SAMPLER) {
if (variable->data.bindless) {
info->const_buffers_declared |= 1;
- info->const_file_max[0] +=
- glsl_count_attribute_slots(type, false);
+ info->const_file_max[0] = max_slot;
} else {
info->samplers_declared |=
u_bit_consecutive(variable->data.binding, aoa_size);
} else if (base_type == GLSL_TYPE_IMAGE) {
if (variable->data.bindless) {
info->const_buffers_declared |= 1;
- info->const_file_max[0] +=
- glsl_count_attribute_slots(type, false);
+ info->const_file_max[0] = max_slot;
} else {
info->images_declared |=
u_bit_consecutive(variable->data.binding, aoa_size);
u_bit_consecutive(0, SI_NUM_CONST_BUFFERS);
} else {
info->const_buffers_declared |= 1;
- info->const_file_max[0] +=
- glsl_count_attribute_slots(type, false);
+ info->const_file_max[0] = max_slot;
}
}
}