From 44681e47955687d5590779fdc44373d3fb204fdc Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Aug 2017 17:33:33 -0700 Subject: nir: Generalize nir_intrinsic_vote_eq The SPIR-V extension wants us to be able to do an AllEqual on any vector or scalar type. This has two implications: 1) We need to be able to handle vectors so we switch the vote_eq intrinsics to be vectorized intrinsics. 2) We need to handle floats which have different behavior with respect to +-0, NaN, etc. than the integer variant so we need two variants. Reviewed-by: Lionel Landwerlin --- src/compiler/glsl/glsl_to_nir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/compiler/glsl') diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 7a9d15015e2..80eb15f1ab1 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -814,7 +814,7 @@ nir_visitor::visit(ir_call *ir) op = nir_intrinsic_vote_all; break; case ir_intrinsic_vote_eq: - op = nir_intrinsic_vote_eq; + op = nir_intrinsic_vote_ieq; break; case ir_intrinsic_ballot: op = nir_intrinsic_ballot; @@ -1163,8 +1163,9 @@ nir_visitor::visit(ir_call *ir) } case nir_intrinsic_vote_any: case nir_intrinsic_vote_all: - case nir_intrinsic_vote_eq: { + case nir_intrinsic_vote_ieq: { nir_ssa_dest_init(&instr->instr, &instr->dest, 1, 32, NULL); + instr->num_components = 1; ir_rvalue *value = (ir_rvalue *) ir->actual_parameters.get_head(); instr->src[0] = nir_src_for_ssa(evaluate_rvalue(value)); -- cgit v1.2.3