summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-11-11 10:15:01 +0100
committerSamuel Pitoiset <[email protected]>2019-11-19 18:01:13 +0000
commit194bee193c547912561259d7ad2e3f0ab0363d1d (patch)
treec1a1a06e5146a65e1b73fa1f80f8552555561eb8 /src/compiler/spirv
parent2941a734a0242bbc3046be65f548d5639e95b167 (diff)
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 <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_subgroup.c12
1 files 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");
}