From: Chris Forbes Date: Sun, 7 Sep 2014 07:24:15 +0000 (+1200) Subject: glsl: add ir reader support for ir_barrier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa49536ab10748f6ab05e930d4b01fe714ea6b59;p=mesa.git glsl: add ir reader support for ir_barrier Picked from the tessellation branch. Reviewed-by: Brian Paul --- 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; +}