From 194bee193c547912561259d7ad2e3f0ab0363d1d Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 11 Nov 2019 10:15:01 +0100 Subject: [PATCH] spirv: fix lowering of OpGroupNonUniformAllEqual It should rely on the source type, not on the return type which is always a boolean anyways, so vote_feq was never selected. For OpSubgroupAllEqualKHR it's always an integer comparison. This fixes some VK_KHR_shader_subgroup_extended_types tests with RADV. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/compiler/spirv/vtn_subgroup.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compiler/spirv/vtn_subgroup.c b/src/compiler/spirv/vtn_subgroup.c index 8339b1a4862..eb255c4106c 100644 --- a/src/compiler/spirv/vtn_subgroup.c +++ b/src/compiler/spirv/vtn_subgroup.c @@ -213,15 +213,22 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, case SpvOpSubgroupAnyKHR: op = nir_intrinsic_vote_any; break; + case SpvOpSubgroupAllEqualKHR: + op = nir_intrinsic_vote_ieq; + break; case SpvOpGroupNonUniformAllEqual: - case SpvOpSubgroupAllEqualKHR: { - switch (glsl_get_base_type(val->type->type)) { + switch (glsl_get_base_type(vtn_ssa_value(b, w[4])->type)) { case GLSL_TYPE_FLOAT: + case GLSL_TYPE_FLOAT16: case GLSL_TYPE_DOUBLE: op = nir_intrinsic_vote_feq; break; case GLSL_TYPE_UINT: case GLSL_TYPE_INT: + case GLSL_TYPE_UINT8: + case GLSL_TYPE_INT8: + case GLSL_TYPE_UINT16: + case GLSL_TYPE_INT16: case GLSL_TYPE_UINT64: case GLSL_TYPE_INT64: case GLSL_TYPE_BOOL: @@ -231,7 +238,6 @@ vtn_handle_subgroup(struct vtn_builder *b, SpvOp opcode, unreachable("Unhandled type"); } break; - } default: unreachable("Unhandled opcode"); } -- 2.30.2