var->data.mode = nir_var_uniform;
break;
+ case ir_var_shader_storage:
+ var->data.mode = nir_var_shader_storage;
+ break;
case ir_var_system_value:
var->data.mode = nir_var_system_value;
break;
case nir_var_uniform:
+ case nir_var_shader_storage:
exec_list_push_tail(&shader->uniforms, &var->node);
break;
nir_var_global,
nir_var_local,
nir_var_uniform,
+ nir_var_shader_storage,
nir_var_system_value
} nir_variable_mode;
return;
}
- if (instr->variables[0]->var->data.mode != nir_var_uniform)
+ if (instr->variables[0]->var->data.mode != nir_var_uniform &&
+ instr->variables[0]->var->data.mode != nir_var_shader_storage)
return; /* atomics passed as function arguments can't be lowered */
void *mem_ctx = ralloc_parent(instr);
* UBO's have their own address spaces, so don't count them towards the
* number of global uniforms
*/
- if (var->data.mode == nir_var_uniform && var->interface_type != NULL)
+ if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
+ var->interface_type != NULL)
continue;
var->data.driver_location = location;
unsigned location = 0;
foreach_list_typed(nir_variable, var, node, var_list) {
- if (var->data.mode == nir_var_uniform && var->interface_type != NULL)
+ if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
+ var->interface_type != NULL)
continue;
if (_mesa_set_search(indirect_set, var))
*direct_size = location;
foreach_list_typed(nir_variable, var, node, var_list) {
- if (var->data.mode == nir_var_uniform && var->interface_type != NULL)
+ if ((var->data.mode == nir_var_uniform || var->data.mode == nir_var_shader_storage) &&
+ var->interface_type != NULL)
continue;
if (!_mesa_set_search(indirect_set, var))
const char *const samp = (var->data.sample) ? "sample " : "";
const char *const inv = (var->data.invariant) ? "invariant " : "";
const char *const mode[] = { "shader_in ", "shader_out ", "", "",
- "uniform ", "system " };
+ "uniform ", "shader_storage", "system " };
const char *const interp[] = { "", "smooth", "flat", "noperspective" };
fprintf(fp, "%s%s%s%s%s ",
if (var->data.mode == nir_var_shader_in ||
var->data.mode == nir_var_shader_out ||
- var->data.mode == nir_var_uniform) {
+ var->data.mode == nir_var_uniform ||
+ var->data.mode == nir_var_shader_storage) {
fprintf(fp, " (%u, %u)", var->data.location, var->data.driver_location);
}
break;
case nir_intrinsic_store_var:
assert(instr->variables[0]->var->data.mode != nir_var_shader_in &&
- instr->variables[0]->var->data.mode != nir_var_uniform);
+ instr->variables[0]->var->data.mode != nir_var_uniform &&
+ instr->variables[0]->var->data.mode != nir_var_shader_storage);
break;
case nir_intrinsic_copy_var:
assert(instr->variables[0]->var->data.mode != nir_var_shader_in &&
- instr->variables[0]->var->data.mode != nir_var_uniform);
+ instr->variables[0]->var->data.mode != nir_var_uniform &&
+ instr->variables[0]->var->data.mode != nir_var_shader_storage);
assert(instr->variables[1]->var->data.mode != nir_var_shader_out);
break;
default: