var->data.read_only = true;
break;
case ir_var_shader_out:
+ case ir_var_shader_storage:
break;
default:
/* The only variables that are added using this function should be
- * uniforms, shader inputs, and shader outputs, constants (which use
- * ir_var_auto), and system values.
+ * uniforms, shader storage, shader inputs, and shader outputs, constants
+ * (which use ir_var_auto), and system values.
*/
assert(0);
break;
case ir_var_uniform:
dest = &ibu;
break;
+ case ir_var_shader_storage:
+ dest = &iss;
+ break;
case ir_var_shader_in:
dest = &ibi;
break;
switch (mode) {
case ir_var_uniform:
return ibu;
+ case ir_var_shader_storage:
+ return iss;
case ir_var_shader_in:
return ibi;
case ir_var_shader_out:
}
symbol_table_entry(ir_variable *v) :
- v(v), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0) {}
+ v(v), f(0), t(0), ibu(0), iss(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(ir_function *f) :
- v(0), f(f), t(0), ibu(0), ibi(0), ibo(0), a(0) {}
+ v(0), f(f), t(0), ibu(0), iss(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(const glsl_type *t) :
- v(0), f(0), t(t), ibu(0), ibi(0), ibo(0), a(0) {}
+ v(0), f(0), t(t), ibu(0), iss(0), ibi(0), ibo(0), a(0) {}
symbol_table_entry(const glsl_type *t, enum ir_variable_mode mode) :
- v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(0)
+ v(0), f(0), t(0), ibu(0), iss(0), ibi(0), ibo(0), a(0)
{
assert(t->is_interface());
add_interface(t, mode);
}
symbol_table_entry(const class ast_type_specifier *a):
- v(0), f(0), t(0), ibu(0), ibi(0), ibo(0), a(a) {}
+ v(0), f(0), t(0), ibu(0), iss(0), ibi(0), ibo(0), a(a) {}
ir_variable *v;
ir_function *f;
const glsl_type *t;
const glsl_type *ibu;
+ const glsl_type *iss;
const glsl_type *ibi;
const glsl_type *ibo;
const class ast_type_specifier *a;
case ir_var_uniform:
return "uniform";
+ case ir_var_shader_storage:
+ return "buffer";
+
case ir_var_shader_in:
return "shader input";
enum ir_variable_mode {
ir_var_auto = 0, /**< Function local variables and globals. */
ir_var_uniform, /**< Variable declared as a uniform. */
+ ir_var_shader_storage, /**< Variable declared as an ssbo. */
ir_var_shader_in,
ir_var_shader_out,
ir_var_function_in,
*/
inline bool is_in_uniform_block() const
{
- return this->data.mode == ir_var_uniform && this->interface_type != NULL;
+ return (this->data.mode == ir_var_uniform ||
+ this->data.mode == ir_var_shader_storage) &&
+ this->interface_type != NULL;
}
/**
switch ((enum ir_variable_mode)(param->data.mode)) {
case ir_var_auto:
case ir_var_uniform:
+ case ir_var_shader_storage:
case ir_var_temporary:
/* These are all error conditions. It is invalid for a parameter to
* a function to be declared as auto (not in, out, or inout) or
const char *const cent = (ir->data.centroid) ? "centroid " : "";
const char *const samp = (ir->data.sample) ? "sample " : "";
const char *const inv = (ir->data.invariant) ? "invariant " : "";
- const char *const mode[] = { "", "uniform ", "shader_in ", "shader_out ",
+ const char *const mode[] = { "", "uniform ", "shader_storage",
+ "shader_in ", "shader_out ",
"in ", "out ", "inout ",
"const_in ", "sys ", "temporary " };
STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
var->data.invariant = 1;
} else if (strcmp(qualifier->value(), "uniform") == 0) {
var->data.mode = ir_var_uniform;
+ } else if (strcmp(qualifier->value(), "shader_storage") == 0) {
+ var->data.mode = ir_var_shader_storage;
} else if (strcmp(qualifier->value(), "auto") == 0) {
var->data.mode = ir_var_auto;
} else if (strcmp(qualifier->value(), "in") == 0) {
unsupported_variable_indexing = true;
break;
case ir_var_uniform:
+ case ir_var_shader_storage:
if (options->EmitNoIndirectUniform)
unsupported_variable_indexing = true;
break;
* but, this will require changes to the other uniform block
* support code.
*/
- if (var->data.mode == ir_var_uniform)
+ if (var->data.mode == ir_var_uniform ||
+ var->data.mode == ir_var_shader_storage)
continue;
const glsl_type * iface_t = var->type;
* but, this will require changes to the other uniform block
* support code.
*/
- if (var->data.mode == ir_var_uniform)
+ if (var->data.mode == ir_var_uniform || var->data.mode == ir_var_shader_storage)
return;
if (var->get_interface_type() != NULL) {
case ir_var_temporary:
return this->lower_temps;
case ir_var_uniform:
+ case ir_var_shader_storage:
return this->lower_uniforms;
case ir_var_function_in:
case ir_var_const_in:
{
assert(var);
- if (!var->type->is_record() || var->data.mode == ir_var_uniform
- || var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out)
+ if (!var->type->is_record() ||
+ var->data.mode == ir_var_uniform || var->data.mode == ir_var_shader_storage ||
+ var->data.mode == ir_var_shader_in || var->data.mode == ir_var_shader_out)
return NULL;
foreach_in_list(variable_entry, entry, &this->variable_list) {