From a318c101bb9eb711d0279b3031b84c44d0f1322f Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 19 Jan 2023 13:24:42 -0800 Subject: [PATCH] microsoft/compiler: Handle i1 overloads Some wave ops can have bool/i1 overloads Part-of: --- src/microsoft/compiler/dxil_enums.c | 1 + src/microsoft/compiler/dxil_enums.h | 1 + src/microsoft/compiler/dxil_module.c | 1 + src/microsoft/compiler/nir_to_dxil.c | 1 + 4 files changed, 4 insertions(+) diff --git a/src/microsoft/compiler/dxil_enums.c b/src/microsoft/compiler/dxil_enums.c index 9d29e49a056..96074576605 100644 --- a/src/microsoft/compiler/dxil_enums.c +++ b/src/microsoft/compiler/dxil_enums.c @@ -155,6 +155,7 @@ enum dxil_primitive_topology dxil_get_primitive_topology(enum shader_prim topolo static const char *overload_str[DXIL_NUM_OVERLOADS] = { [DXIL_NONE] = "", + [DXIL_I1] = "i1", [DXIL_I16] = "i16", [DXIL_I32] = "i32", [DXIL_I64] = "i64", diff --git a/src/microsoft/compiler/dxil_enums.h b/src/microsoft/compiler/dxil_enums.h index ae421d693f4..7241de189d9 100644 --- a/src/microsoft/compiler/dxil_enums.h +++ b/src/microsoft/compiler/dxil_enums.h @@ -197,6 +197,7 @@ enum dxil_interpolation_mode { enum overload_type { DXIL_NONE, + DXIL_I1, DXIL_I16, DXIL_I32, DXIL_I64, diff --git a/src/microsoft/compiler/dxil_module.c b/src/microsoft/compiler/dxil_module.c index cb44c99027a..89cdfac1f30 100644 --- a/src/microsoft/compiler/dxil_module.c +++ b/src/microsoft/compiler/dxil_module.c @@ -675,6 +675,7 @@ const struct dxil_type * dxil_get_overload_type(struct dxil_module *mod, enum overload_type overload) { switch (overload) { + case DXIL_I1: return get_int1_type(mod); case DXIL_I16: return get_int16_type(mod); case DXIL_I32: return get_int32_type(mod); case DXIL_I64: return get_int64_type(mod); diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 948412ddde9..899462e726a 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -2215,6 +2215,7 @@ get_overload(nir_alu_type alu_type, unsigned bit_size) case nir_type_int: case nir_type_uint: switch (bit_size) { + case 1: return DXIL_I1; case 16: return DXIL_I16; case 32: return DXIL_I32; case 64: return DXIL_I64;