glsl: add intrinsics for ARB_shader_group_vote and ARB_shader_ballot
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 19 Apr 2017 08:08:25 +0000 (10:08 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 28 Apr 2017 09:33:58 +0000 (11:33 +0200)
These operations are currently implemented as IR expressions. However,
they cannot be transformed and moved in the way that other IR
expressions can because they have non-trivial interactions with
control-flow.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/compiler/glsl/ir.h
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index d7a81c5196d54e1d2c44fc8dc1af657c1719befe..9ab4df7219e91844cf535bf065ff8d416718ade3 100644 (file)
@@ -1098,6 +1098,13 @@ enum ir_intrinsic_id {
    ir_intrinsic_memory_barrier_image,
    ir_intrinsic_memory_barrier_shared,
 
+   ir_intrinsic_vote_all,
+   ir_intrinsic_vote_any,
+   ir_intrinsic_vote_eq,
+   ir_intrinsic_ballot,
+   ir_intrinsic_read_invocation,
+   ir_intrinsic_read_first_invocation,
+
    ir_intrinsic_shared_load,
    ir_intrinsic_shared_store = MAKE_INTRINSIC_FOR_TYPE(store, shared),
    ir_intrinsic_shared_atomic_add = MAKE_INTRINSIC_FOR_TYPE(atomic_add, shared),
index 8ca90f6c43d89caf0911d1811a47b95ad624a139..85a55afb37ea1663d7176a3e799a1ab1a7b02aca 100644 (file)
@@ -3994,6 +3994,12 @@ glsl_to_tgsi_visitor::visit(ir_call *ir)
       return;
    }
 
+   case ir_intrinsic_vote_all:
+   case ir_intrinsic_vote_any:
+   case ir_intrinsic_vote_eq:
+   case ir_intrinsic_ballot:
+   case ir_intrinsic_read_first_invocation:
+   case ir_intrinsic_read_invocation:
    case ir_intrinsic_invalid:
    case ir_intrinsic_generic_load:
    case ir_intrinsic_generic_store: