From e7f628c2fc5ef42672e3281e224226c3d47b1bac Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 7 Sep 2014 19:24:15 +1200 Subject: glsl: Add ir node for barrier v2: * Changes suggested by mattst88 [jordan.l.justen@intel.com: Add nir support] Signed-off-by: Jordan Justen Reviewed-by: Ben Widawsky --- src/mesa/drivers/dri/i965/brw_vec4.h | 1 + src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 ++++++ src/mesa/program/ir_to_mesa.cpp | 7 +++++++ src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 +++++++ 4 files changed, 21 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 06a16a49b6f..4449e0a52ce 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -160,6 +160,7 @@ public: virtual void visit(ir_if *); virtual void visit(ir_emit_vertex *); virtual void visit(ir_end_primitive *); + virtual void visit(ir_barrier *); /*@}*/ src_reg result; diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 242d007b355..0a76bde7726 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2966,6 +2966,12 @@ vec4_visitor::visit(ir_end_primitive *) unreachable("not reached"); } +void +vec4_visitor::visit(ir_barrier *) +{ + unreachable("not reached"); +} + void vec4_visitor::emit_untyped_atomic(unsigned atomic_op, unsigned surf_index, dst_reg dst, src_reg offset, diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 514bb930e76..18e3bc5d5cc 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -262,6 +262,7 @@ public: virtual void visit(ir_if *); virtual void visit(ir_emit_vertex *); virtual void visit(ir_end_primitive *); + virtual void visit(ir_barrier *); /*@}*/ src_reg result; @@ -2117,6 +2118,12 @@ ir_to_mesa_visitor::visit(ir_end_primitive *) assert(!"Geometry shaders not supported."); } +void +ir_to_mesa_visitor::visit(ir_barrier *) +{ + unreachable("GLSL barrier() not supported."); +} + ir_to_mesa_visitor::ir_to_mesa_visitor() { result.file = PROGRAM_UNDEFINED; diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 0e60d95c575..03834b69a23 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -395,6 +395,7 @@ public: virtual void visit(ir_if *); virtual void visit(ir_emit_vertex *); virtual void visit(ir_end_primitive *); + virtual void visit(ir_barrier *); /*@}*/ st_src_reg result; @@ -3417,6 +3418,12 @@ glsl_to_tgsi_visitor::visit(ir_end_primitive *ir) emit_asm(ir, TGSI_OPCODE_ENDPRIM, undef_dst, this->result); } +void +glsl_to_tgsi_visitor::visit(ir_barrier *ir) +{ + unreachable("Not implemented!"); +} + glsl_to_tgsi_visitor::glsl_to_tgsi_visitor() { result.file = PROGRAM_UNDEFINED; -- cgit v1.2.3