From 3a53e46fcda431f35f302cdc8c908efac6630326 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 4 Feb 2022 17:36:56 -0500 Subject: [PATCH] pan/mdg: Handle 8/16-bit UBO loads These will be seen by the compiler when we enable fp16 constant buffers. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_compile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 4dabf8bf9a4..71bb4c6a954 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -131,6 +131,8 @@ schedule_barrier(compiler_context *ctx) M_LOAD(ld_attr_32, nir_type_uint32); M_LOAD(ld_vary_32, nir_type_uint32); +M_LOAD(ld_ubo_u8, nir_type_uint32); /* mandatory extension to 32-bit */ +M_LOAD(ld_ubo_u16, nir_type_uint32); M_LOAD(ld_ubo_32, nir_type_uint32); M_LOAD(ld_ubo_64, nir_type_uint32); M_LOAD(ld_ubo_128, nir_type_uint32); @@ -1236,7 +1238,11 @@ emit_ubo_read( unsigned bitsize = dest_size * nr_comps; /* Pick the smallest intrinsic to avoid out-of-bounds reads */ - if (bitsize <= 32) + if (bitsize <= 8) + ins = m_ld_ubo_u8(dest, 0); + else if (bitsize <= 16) + ins = m_ld_ubo_u16(dest, 0); + else if (bitsize <= 32) ins = m_ld_ubo_32(dest, 0); else if (bitsize <= 64) ins = m_ld_ubo_64(dest, 0);