From 60e843c4d5a5688196d13611a357cdc5b1b1141d Mon Sep 17 00:00:00 2001 From: Plamena Manolova Date: Fri, 27 Apr 2018 14:12:30 +0100 Subject: mesa: Add GL/GLSL plumbing for ARB_fragment_shader_interlock. This extension provides new GLSL built-in functions beginInvocationInterlockARB() and endInvocationInterlockARB() that delimit a critical section of fragment shader code. For pairs of shader invocations with "overlapping" coverage in a given pixel, the OpenGL implementation will guarantee that the critical section of the fragment shader will be executed for only one fragment at a time. Signed-off-by: Plamena Manolova Reviewed-by: Francisco Jerez --- src/compiler/glsl/glsl_to_nir.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/compiler/glsl/glsl_to_nir.cpp') diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 8e5e9c34912..dc3e822308b 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -752,6 +752,12 @@ nir_visitor::visit(ir_call *ir) case ir_intrinsic_shader_clock: op = nir_intrinsic_shader_clock; break; + case ir_intrinsic_begin_invocation_interlock: + op = nir_intrinsic_begin_invocation_interlock; + break; + case ir_intrinsic_end_invocation_interlock: + op = nir_intrinsic_end_invocation_interlock; + break; case ir_intrinsic_group_memory_barrier: op = nir_intrinsic_group_memory_barrier; break; @@ -970,6 +976,12 @@ nir_visitor::visit(ir_call *ir) instr->num_components = 2; nir_builder_instr_insert(&b, &instr->instr); break; + case nir_intrinsic_begin_invocation_interlock: + nir_builder_instr_insert(&b, &instr->instr); + break; + case nir_intrinsic_end_invocation_interlock: + nir_builder_instr_insert(&b, &instr->instr); + break; case nir_intrinsic_store_ssbo: { exec_node *param = ir->actual_parameters.get_head(); ir_rvalue *block = ((ir_instruction *)param)->as_rvalue(); -- cgit v1.2.3