summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ir.cpp1
-rw-r--r--src/glsl/ir.h10
-rw-r--r--src/glsl/ir_validate.cpp7
3 files changed, 17 insertions, 1 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index b0e38d820e6..f59cdd29ab8 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -480,6 +480,7 @@ static const char *const operator_strs[] = {
"min",
"max",
"pow",
+ "ubo_load",
"vector",
};
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index f019837d5f7..89c516c877d 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1018,9 +1018,17 @@ enum ir_expression_operation {
ir_binop_pow,
/**
+ * Load a value the size of a given GLSL type from a uniform block.
+ *
+ * operand0 is the ir_constant uniform block index in the linked shader.
+ * operand1 is a byte offset within the uniform block.
+ */
+ ir_binop_ubo_load,
+
+ /**
* A sentinel marking the last of the binary operations.
*/
- ir_last_binop = ir_binop_pow,
+ ir_last_binop = ir_binop_ubo_load,
ir_quadop_vector,
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 191d3983109..af0b5768ac0 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -423,6 +423,13 @@ ir_validate::visit_leave(ir_expression *ir)
assert(ir->operands[0]->type == ir->operands[1]->type);
break;
+ case ir_binop_ubo_load:
+ assert(ir->operands[0]->as_constant());
+ assert(ir->operands[0]->type == glsl_type::uint_type);
+
+ assert(ir->operands[1]->type == glsl_type::uint_type);
+ break;
+
case ir_quadop_vector:
/* The vector operator collects some number of scalars and generates a
* vector from them.