panfrost: support 16-bit vertex attributes
There is no auto32 equivalent for 16-bit types, we need to select specific register formats. Signed-off-by: Benjamin Lee <benjamin.lee@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33078>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user