bool var_is_in_block;
int top_level_array_size;
int top_level_array_stride;
- int main_uniform_storage_index;
struct type_tree_entry *current_type;
};
for (unsigned i = 0; i < num_params; i++) {
struct gl_program_parameter *param = ¶ms->Parameters[base_index + i];
param->UniformStorageIndex = uniform - prog->data->UniformStorage;
- param->MainUniformStorageIndex = state->main_uniform_storage_index;
+ param->MainUniformStorageIndex = state->current_var->data.location;
}
}
return -1;
}
- if (state->main_uniform_storage_index == -1)
- state->main_uniform_storage_index = prog->data->NumUniformStorage;
-
uniform = &prog->data->UniformStorage[prog->data->NumUniformStorage];
prog->data->NumUniformStorage++;
uniform->array_stride = glsl_type_is_array(type) ?
glsl_get_explicit_stride(type) : 0;
- if (glsl_type_is_matrix(type)) {
- assert(parent_type);
- uniform->matrix_stride = glsl_get_explicit_stride(type);
-
- uniform->row_major = glsl_matrix_type_is_row_major(type);
+ if (glsl_type_is_matrix(uniform->type)) {
+ uniform->matrix_stride = glsl_get_explicit_stride(uniform->type);
+ uniform->row_major = glsl_matrix_type_is_row_major(uniform->type);
} else {
uniform->matrix_stride = 0;
}
nir_foreach_variable(var, &nir->uniforms) {
struct gl_uniform_storage *uniform = NULL;
+ state.current_var = var;
+
/* Check if the uniform has been processed already for
* other stage. If so, validate they are compatible and update
* the active stage mask.
/* From now on the variable’s location will be its uniform index */
var->data.location = prog->data->NumUniformStorage;
- state.current_var = var;
state.offset = 0;
state.var_is_in_block = nir_variable_is_in_block(var);
state.top_level_array_size = 0;
state.top_level_array_stride = 0;
- state.main_uniform_storage_index = -1;
/*
* From ARB_program_interface spec, issue (16):