diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 1cf3b2c35f8..3ce9ad645a5 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -480,9 +480,27 @@ bi_emit_load_attr(bi_builder *b, nir_intrinsic_instr *instr) * s32) source, so use .auto32 to disregard. */ nir_alu_type T = nir_intrinsic_dest_type(instr); - assert(T == nir_type_uint32 || T == nir_type_int32 || T == nir_type_float32); - enum bi_register_format regfmt = - T == nir_type_float32 ? BI_REGISTER_FORMAT_F32 : BI_REGISTER_FORMAT_AUTO; + enum bi_register_format regfmt = BI_REGISTER_FORMAT_AUTO; + switch (T) { + case nir_type_uint32: + case nir_type_int32: + regfmt = BI_REGISTER_FORMAT_AUTO; + break; + case nir_type_float32: + regfmt = BI_REGISTER_FORMAT_F32; + break; + case nir_type_uint16: + regfmt = BI_REGISTER_FORMAT_U16; + break; + case nir_type_int16: + regfmt = BI_REGISTER_FORMAT_S16; + break; + case nir_type_float16: + regfmt = BI_REGISTER_FORMAT_F16; + break; + default: + assert("unsupported attribute type" && false); + } nir_src *offset = nir_get_io_offset_src(instr); unsigned component = nir_intrinsic_component(instr);