diff options
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/builtin_functions.cpp | 17 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.cpp | 1 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.h | 2 | ||||
-rw-r--r-- | src/compiler/glsl/glsl_to_nir.cpp | 6 | ||||
-rw-r--r-- | src/compiler/glsl/ir.h | 1 |
5 files changed, 27 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index b6018806865..5650365d1d5 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -526,6 +526,12 @@ supports_nv_fragment_shader_interlock(const _mesa_glsl_parse_state *state) } static bool +supports_intel_fragment_shader_ordering(const _mesa_glsl_parse_state *state) +{ + return state->INTEL_fragment_shader_ordering_enable; +} + +static bool shader_clock(const _mesa_glsl_parse_state *state) { return state->ARB_shader_clock_enable; @@ -1305,6 +1311,11 @@ builtin_builder::create_intrinsics() supports_arb_fragment_shader_interlock, ir_intrinsic_end_invocation_interlock), NULL); + add_function("__intrinsic_begin_fragment_shader_ordering", + _invocation_interlock_intrinsic( + supports_intel_fragment_shader_ordering, + ir_intrinsic_begin_fragment_shader_ordering), NULL); + add_function("__intrinsic_shader_clock", _shader_clock_intrinsic(shader_clock, glsl_type::uvec2_type), @@ -3419,6 +3430,12 @@ builtin_builder::create_builtins() supports_nv_fragment_shader_interlock), NULL); + add_function("beginFragmentShaderOrderingINTEL", + _invocation_interlock( + "__intrinsic_begin_fragment_shader_ordering", + supports_intel_fragment_shader_ordering), + NULL); + add_function("anyInvocationARB", _vote("__intrinsic_vote_any", vote), NULL); diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 0a7d0d78b14..21d41224440 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -725,6 +725,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT_AEP(EXT_texture_buffer), EXT_AEP(EXT_texture_cube_map_array), EXT(INTEL_conservative_rasterization), + EXT(INTEL_fragment_shader_ordering), EXT(INTEL_shader_atomic_float_minmax), EXT(MESA_shader_integer_functions), EXT(NV_fragment_shader_interlock), diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 2c8353214aa..e03b34d7d6c 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -812,6 +812,8 @@ struct _mesa_glsl_parse_state { bool EXT_texture_cube_map_array_warn; bool INTEL_conservative_rasterization_enable; bool INTEL_conservative_rasterization_warn; + bool INTEL_fragment_shader_ordering_enable; + bool INTEL_fragment_shader_ordering_warn; bool INTEL_shader_atomic_float_minmax_enable; bool INTEL_shader_atomic_float_minmax_warn; bool MESA_shader_integer_functions_enable; diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index a53000f47e9..efbb2317ac6 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -742,6 +742,9 @@ nir_visitor::visit(ir_call *ir) case ir_intrinsic_end_invocation_interlock: op = nir_intrinsic_end_invocation_interlock; break; + case ir_intrinsic_begin_fragment_shader_ordering: + op = nir_intrinsic_begin_fragment_shader_ordering; + break; case ir_intrinsic_group_memory_barrier: op = nir_intrinsic_group_memory_barrier; break; @@ -975,6 +978,9 @@ nir_visitor::visit(ir_call *ir) case nir_intrinsic_end_invocation_interlock: nir_builder_instr_insert(&b, &instr->instr); break; + case nir_intrinsic_begin_fragment_shader_ordering: + 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(); diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h index d05d1998a50..f478b29a6b5 100644 --- a/src/compiler/glsl/ir.h +++ b/src/compiler/glsl/ir.h @@ -1122,6 +1122,7 @@ enum ir_intrinsic_id { ir_intrinsic_memory_barrier_shared, ir_intrinsic_begin_invocation_interlock, ir_intrinsic_end_invocation_interlock, + ir_intrinsic_begin_fragment_shader_ordering, ir_intrinsic_vote_all, ir_intrinsic_vote_any, |