- ubo_var_index = var->location;
- ubo_var = &block->Uniforms[var->location];
- ubo_byte_offset = ubo_var->Offset;
- }
-
- process(var);
+ /* Uniform blocks that were specified with an instance name must be
+ * handled a little bit differently. The name of the variable is the
+ * name used to reference the uniform block instead of being the name
+ * of a variable within the block. Therefore, searching for the name
+ * within the block will fail.
+ */
+ if (var->is_interface_instance()) {
+ ubo_byte_offset = 0;
+ ubo_row_major = false;
+ } else {
+ const struct gl_uniform_block *const block =
+ &prog->UniformBlocks[ubo_block_index];
+
+ assert(var->location != -1);
+
+ const struct gl_uniform_buffer_variable *const ubo_var =
+ &block->Uniforms[var->location];
+
+ ubo_row_major = ubo_var->RowMajor;
+ ubo_byte_offset = ubo_var->Offset;
+ }
+
+ if (var->is_interface_instance())
+ process(var->interface_type, var->interface_type->name);
+ else
+ process(var);
+ } else
+ process(var);