summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index aba8d70a8a0..a53000f47e9 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -709,6 +709,8 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_ssbo_atomic_imin;
else if (ir->return_deref->type == glsl_type::uint_type)
op = nir_intrinsic_ssbo_atomic_umin;
+ else if (ir->return_deref->type == glsl_type::float_type)
+ op = nir_intrinsic_ssbo_atomic_fmin;
else
unreachable("Invalid type");
break;
@@ -718,6 +720,8 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_ssbo_atomic_imax;
else if (ir->return_deref->type == glsl_type::uint_type)
op = nir_intrinsic_ssbo_atomic_umax;
+ else if (ir->return_deref->type == glsl_type::float_type)
+ op = nir_intrinsic_ssbo_atomic_fmax;
else
unreachable("Invalid type");
break;
@@ -725,7 +729,9 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_ssbo_atomic_exchange;
break;
case ir_intrinsic_ssbo_atomic_comp_swap:
- op = nir_intrinsic_ssbo_atomic_comp_swap;
+ op = ir->return_deref->type->is_integer_32_64()
+ ? nir_intrinsic_ssbo_atomic_comp_swap
+ : nir_intrinsic_ssbo_atomic_fcomp_swap;
break;
case ir_intrinsic_shader_clock:
op = nir_intrinsic_shader_clock;
@@ -777,6 +783,8 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_shared_atomic_imin;
else if (ir->return_deref->type == glsl_type::uint_type)
op = nir_intrinsic_shared_atomic_umin;
+ else if (ir->return_deref->type == glsl_type::float_type)
+ op = nir_intrinsic_shared_atomic_fmin;
else
unreachable("Invalid type");
break;
@@ -786,6 +794,8 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_shared_atomic_imax;
else if (ir->return_deref->type == glsl_type::uint_type)
op = nir_intrinsic_shared_atomic_umax;
+ else if (ir->return_deref->type == glsl_type::float_type)
+ op = nir_intrinsic_shared_atomic_fmax;
else
unreachable("Invalid type");
break;
@@ -793,7 +803,9 @@ nir_visitor::visit(ir_call *ir)
op = nir_intrinsic_shared_atomic_exchange;
break;
case ir_intrinsic_shared_atomic_comp_swap:
- op = nir_intrinsic_shared_atomic_comp_swap;
+ op = ir->return_deref->type->is_integer_32_64()
+ ? nir_intrinsic_shared_atomic_comp_swap
+ : nir_intrinsic_shared_atomic_fcomp_swap;
break;
case ir_intrinsic_vote_any:
op = nir_intrinsic_vote_any;
@@ -1042,7 +1054,10 @@ nir_visitor::visit(ir_call *ir)
case nir_intrinsic_ssbo_atomic_xor:
case nir_intrinsic_ssbo_atomic_exchange:
case nir_intrinsic_ssbo_atomic_comp_swap:
- case nir_intrinsic_ssbo_atomic_fadd: {
+ case nir_intrinsic_ssbo_atomic_fadd:
+ case nir_intrinsic_ssbo_atomic_fmin:
+ case nir_intrinsic_ssbo_atomic_fmax:
+ case nir_intrinsic_ssbo_atomic_fcomp_swap: {
int param_count = ir->actual_parameters.length();
assert(param_count == 3 || param_count == 4);
@@ -1063,7 +1078,8 @@ nir_visitor::visit(ir_call *ir)
/* data2 parameter (only with atomic_comp_swap) */
if (param_count == 4) {
- assert(op == nir_intrinsic_ssbo_atomic_comp_swap);
+ assert(op == nir_intrinsic_ssbo_atomic_comp_swap ||
+ op == nir_intrinsic_ssbo_atomic_fcomp_swap);
param = param->get_next();
inst = (ir_instruction *) param;
instr->src[3] = nir_src_for_ssa(evaluate_rvalue(inst->as_rvalue()));
@@ -1126,7 +1142,10 @@ nir_visitor::visit(ir_call *ir)
case nir_intrinsic_shared_atomic_xor:
case nir_intrinsic_shared_atomic_exchange:
case nir_intrinsic_shared_atomic_comp_swap:
- case nir_intrinsic_shared_atomic_fadd: {
+ case nir_intrinsic_shared_atomic_fadd:
+ case nir_intrinsic_shared_atomic_fmin:
+ case nir_intrinsic_shared_atomic_fmax:
+ case nir_intrinsic_shared_atomic_fcomp_swap: {
int param_count = ir->actual_parameters.length();
assert(param_count == 2 || param_count == 3);
@@ -1142,7 +1161,8 @@ nir_visitor::visit(ir_call *ir)
/* data2 parameter (only with atomic_comp_swap) */
if (param_count == 3) {
- assert(op == nir_intrinsic_shared_atomic_comp_swap);
+ assert(op == nir_intrinsic_shared_atomic_comp_swap ||
+ op == nir_intrinsic_shared_atomic_fcomp_swap);
param = param->get_next();
inst = (ir_instruction *) param;
instr->src[2] =