diff options
author | Ian Romanick <[email protected]> | 2018-04-18 13:20:25 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2018-08-22 20:31:32 -0700 |
commit | 280ab4afa8a4a4b90a70df2337e5fcad485239ec (patch) | |
tree | cd475c2dcaa43724b8e4def68abe6e883a714543 /src | |
parent | c9d52c83a4ac3d534e325f0d361a34c6f90136fb (diff) |
glsl: Add built-in functions for INTEL_shader_atomic_float_minmax
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/builtin_functions.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 88a6ccecb75..2a3138ad0a5 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -676,7 +676,20 @@ shader_atomic_float_add(const _mesa_glsl_parse_state *state) static bool shader_atomic_float_exchange(const _mesa_glsl_parse_state *state) { - return state->NV_shader_atomic_float_enable; + return state->NV_shader_atomic_float_enable || + state->INTEL_shader_atomic_float_minmax_enable; +} + +static bool +INTEL_shader_atomic_float_minmax_supported(const _mesa_glsl_parse_state *state) +{ + return state->extensions->INTEL_shader_atomic_float_minmax; +} + +static bool +shader_atomic_float_minmax(const _mesa_glsl_parse_state *state) +{ + return state->INTEL_shader_atomic_float_minmax_enable; } /** @} */ @@ -1178,6 +1191,9 @@ builtin_builder::create_intrinsics() _atomic_intrinsic2(buffer_atomics_supported, glsl_type::int_type, ir_intrinsic_generic_atomic_min), + _atomic_intrinsic2(INTEL_shader_atomic_float_minmax_supported, + glsl_type::float_type, + ir_intrinsic_generic_atomic_min), _atomic_counter_intrinsic1(shader_atomic_counter_ops_or_v460_desktop, ir_intrinsic_atomic_counter_min), NULL); @@ -1188,6 +1204,9 @@ builtin_builder::create_intrinsics() _atomic_intrinsic2(buffer_atomics_supported, glsl_type::int_type, ir_intrinsic_generic_atomic_max), + _atomic_intrinsic2(INTEL_shader_atomic_float_minmax_supported, + glsl_type::float_type, + ir_intrinsic_generic_atomic_max), _atomic_counter_intrinsic1(shader_atomic_counter_ops_or_v460_desktop, ir_intrinsic_atomic_counter_max), NULL); @@ -1241,6 +1260,9 @@ builtin_builder::create_intrinsics() _atomic_intrinsic3(buffer_atomics_supported, glsl_type::int_type, ir_intrinsic_generic_atomic_comp_swap), + _atomic_intrinsic3(INTEL_shader_atomic_float_minmax_supported, + glsl_type::float_type, + ir_intrinsic_generic_atomic_comp_swap), _atomic_counter_intrinsic2(shader_atomic_counter_ops_or_v460_desktop, ir_intrinsic_atomic_counter_comp_swap), NULL); @@ -3186,6 +3208,9 @@ builtin_builder::create_builtins() _atomic_op2("__intrinsic_atomic_min", buffer_atomics_supported, glsl_type::int_type), + _atomic_op2("__intrinsic_atomic_min", + shader_atomic_float_minmax, + glsl_type::float_type), NULL); add_function("atomicMax", _atomic_op2("__intrinsic_atomic_max", @@ -3194,6 +3219,9 @@ builtin_builder::create_builtins() _atomic_op2("__intrinsic_atomic_max", buffer_atomics_supported, glsl_type::int_type), + _atomic_op2("__intrinsic_atomic_max", + shader_atomic_float_minmax, + glsl_type::float_type), NULL); add_function("atomicAnd", _atomic_op2("__intrinsic_atomic_and", @@ -3237,6 +3265,9 @@ builtin_builder::create_builtins() _atomic_op3("__intrinsic_atomic_comp_swap", buffer_atomics_supported, glsl_type::int_type), + _atomic_op3("__intrinsic_atomic_comp_swap", + shader_atomic_float_minmax, + glsl_type::float_type), NULL); add_function("min3", |