diff options
author | Matt Turner <[email protected]> | 2017-06-20 22:37:43 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2017-07-20 16:56:49 -0700 |
commit | ba2fbbf1c0dacfad45ad59b32de6297239c0f88d (patch) | |
tree | ecf05411929fc8f69f30c536a8cc872f5a370dcb /src/compiler/glsl/glsl_to_nir.cpp | |
parent | 0e6ad379dd8f05720b62d5acf6fa446f7094a853 (diff) |
nir: Add intrinsics from ARB_shader_group_vote
These are intrinsics rather than opcodes, because they operate across
channels.
Reviewed-by: Connor Abbott <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_to_nir.cpp')
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 21530040a96..01166f68655 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -799,6 +799,15 @@ nir_visitor::visit(ir_call *ir) case ir_intrinsic_shared_atomic_comp_swap: op = nir_intrinsic_shared_atomic_comp_swap; break; + case ir_intrinsic_vote_any: + op = nir_intrinsic_vote_any; + break; + case ir_intrinsic_vote_all: + op = nir_intrinsic_vote_all; + break; + case ir_intrinsic_vote_eq: + op = nir_intrinsic_vote_eq; + break; default: unreachable("not reached"); } @@ -1135,6 +1144,19 @@ nir_visitor::visit(ir_call *ir) nir_builder_instr_insert(&b, &instr->instr); break; } + case nir_intrinsic_vote_any: + case nir_intrinsic_vote_all: + case nir_intrinsic_vote_eq: { + nir_ssa_dest_init(&instr->instr, &instr->dest, 1, 32, NULL); + + instr->variables[0] = evaluate_deref(&instr->instr, ir->return_deref); + + ir_rvalue *value = (ir_rvalue *) ir->actual_parameters.get_head(); + instr->src[0] = nir_src_for_ssa(evaluate_rvalue(value)); + + nir_builder_instr_insert(&b, &instr->instr); + break; + } default: unreachable("not reached"); } |