summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-09-07 19:24:15 +1200
committerMarek Olšák <[email protected]>2015-06-16 15:47:02 +0200
commitfa49536ab10748f6ab05e930d4b01fe714ea6b59 (patch)
treec56a1c13feeebceb63ac5ab890e7c56899a10d5e /src
parent2f86c22e75a3273a7541f88ffedd2edefaf6f482 (diff)
glsl: add ir reader support for ir_barrier
Picked from the tessellation branch. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ir_reader.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index fd318c046e2..4eae4131c57 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -63,6 +63,7 @@ private:
ir_texture *read_texture(s_expression *);
ir_emit_vertex *read_emit_vertex(s_expression *);
ir_end_primitive *read_end_primitive(s_expression *);
+ ir_barrier *read_barrier(s_expression *);
ir_dereference *read_dereference(s_expression *);
ir_dereference_variable *read_var_ref(s_expression *);
@@ -375,6 +376,8 @@ ir_reader::read_instruction(s_expression *expr, ir_loop *loop_ctx)
inst = read_emit_vertex(list);
} else if (strcmp(tag->value(), "end-primitive") == 0) {
inst = read_end_primitive(list);
+ } else if (strcmp(tag->value(), "barrier") == 0) {
+ inst = read_barrier(list);
} else {
inst = read_rvalue(list);
if (inst == NULL)
@@ -1142,3 +1145,15 @@ ir_reader::read_end_primitive(s_expression *expr)
ir_read_error(NULL, "when reading end-primitive");
return NULL;
}
+
+ir_barrier *
+ir_reader::read_barrier(s_expression *expr)
+{
+ s_pattern pat[] = { "barrier" };
+
+ if (MATCH(expr, pat)) {
+ return new(mem_ctx) ir_barrier();
+ }
+ ir_read_error(NULL, "when reading barrier");
+ return NULL;
+}