* it's not clear from the spec whether they need to match, but
* Mesa's implementation relies on them matching.
*/
- if (a->instance_name != NULL && mode != ir_var_uniform &&
+ if (a->instance_name != NULL &&
+ mode != ir_var_uniform && mode != ir_var_shader_storage &&
strcmp(a->instance_name, b->instance_name) != 0) {
return false;
}
interface_block_definitions in_interfaces;
interface_block_definitions out_interfaces;
interface_block_definitions uniform_interfaces;
+ interface_block_definitions buffer_interfaces;
for (unsigned int i = 0; i < num_shaders; i++) {
if (shader_list[i] == NULL)
case ir_var_uniform:
definitions = &uniform_interfaces;
break;
+ case ir_var_shader_storage:
+ definitions = &buffer_interfaces;
+ break;
default:
/* Only in, out, and uniform interfaces are legal, so we should
* never get here.
const gl_shader *stage = stages[i];
foreach_in_list(ir_instruction, node, stage->ir) {
ir_variable *var = node->as_variable();
- if (!var || !var->get_interface_type() || var->data.mode != ir_var_uniform)
+ if (!var || !var->get_interface_type() ||
+ (var->data.mode != ir_var_uniform &&
+ var->data.mode != ir_var_shader_storage))
continue;
interface_block_definition *old_def =
* uniform matchin rules (for uniforms, it is as though all
* shaders are in the same shader stage).
*/
- if (!intrastage_match(old_def, &new_def, ir_var_uniform, prog)) {
+ if (!intrastage_match(old_def, &new_def,
+ (ir_variable_mode) var->data.mode,
+ prog)) {
linker_error(prog, "definitions of interface block `%s' do not "
"match\n", var->get_interface_type()->name);
return;
if ((var == NULL) || !var->is_in_buffer_block())
continue;
- assert(var->data.mode == ir_var_uniform);
+ assert(var->data.mode == ir_var_uniform ||
+ var->data.mode == ir_var_shader_storage);
if (var->is_interface_instance()) {
var->data.location = 0;
foreach_in_list(ir_instruction, node, sh->ir) {
ir_variable *const var = node->as_variable();
- if ((var == NULL) || (var->data.mode != ir_var_uniform))
+ if ((var == NULL) || (var->data.mode != ir_var_uniform &&
+ var->data.mode != ir_var_shader_storage))
continue;
uniform_size.process(var);
foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) {
ir_variable *const var = node->as_variable();
- if ((var == NULL) || (var->data.mode != ir_var_uniform))
+ if ((var == NULL) || (var->data.mode != ir_var_uniform && var->data.mode != ir_var_shader_storage))
continue;
parcel.set_and_process(prog, var);
if (var == NULL)
continue;
- if (uniforms_only && (var->data.mode != ir_var_uniform))
+ if (uniforms_only && (var->data.mode != ir_var_uniform && var->data.mode != ir_var_shader_storage))
continue;
/* Don't cross validate temporaries that are at global scope. These
foreach_in_list(ir_instruction, node, sh->ir) {
ir_variable *var = node->as_variable();
- if ((var && var->data.mode == ir_var_uniform) &&
+ if (var && (var->data.mode == ir_var_uniform || var->data.mode == ir_var_shader_storage) &&
var->data.explicit_location) {
if (!reserve_explicit_locations(prog, uniform_map, var)) {
delete uniform_map;