diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-09-20 10:50:37 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-09-30 12:44:30 -0700 |
commit | 61fa4b5707f20d1c281d35e942b6aa462f75612a (patch) | |
tree | 3acffcb430a11481dd8e47712bc6d837d5b177b6 /src/compiler/glsl/glsl_to_nir.cpp | |
parent | 3439956377f903ed7e673f020cd9e7dc0a980128 (diff) |
glsl: Add helperInvocationEXT() builtin
From EXT_demote_to_helper_invocation, implemented with the existing
nir_intrinsic_is_helper_invocation.
Such builtin is necessary when using `demote` because we can't
redefine the value of gl_HelperInvocation (since it is an input
variable).
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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 883cfb57601..2238bf68044 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -1166,6 +1166,9 @@ nir_visitor::visit(ir_call *ir) case ir_intrinsic_read_first_invocation: op = nir_intrinsic_read_first_invocation; break; + case ir_intrinsic_helper_invocation: + op = nir_intrinsic_is_helper_invocation; + break; default: unreachable("not reached"); } @@ -1641,6 +1644,12 @@ nir_visitor::visit(ir_call *ir) nir_builder_instr_insert(&b, &instr->instr); break; } + case nir_intrinsic_is_helper_invocation: { + nir_ssa_dest_init(&instr->instr, &instr->dest, 1, 1, NULL); + instr->num_components = 1; + nir_builder_instr_insert(&b, &instr->instr); + break; + } default: unreachable("not reached"); } |