{
b->cursor = nir_before_instr(&instr->instr);
- if (instr->intrinsic == nir_intrinsic_load_ubo) {
+ /* Increase all UBO binding points by 1. */
+ if (instr->intrinsic == nir_intrinsic_load_ubo &&
+ !b->shader->info.first_ubo_is_default_ubo) {
nir_ssa_def *old_idx = nir_ssa_for_src(b, instr->src[0], 1);
nir_ssa_def *new_idx = nir_iadd(b, old_idx, nir_imm_int(b, 1));
nir_instr_rewrite_src(&instr->instr, &instr->src[0],
}
}
+ shader->info.first_ubo_is_default_ubo = true;
return progress;
}
/* The size of the gl_CullDistance[] array, if declared. */
unsigned cull_distance_array_size;
+ /* Whether the first UBO is the default uniform buffer, i.e. uniforms. */
+ bool first_ubo_is_default_ubo;
+
/* Whether or not separate shader objects were used */
bool separate_shader;