agx: add helper to pad 16-bit to 32-bit

this is a bit tricky to get right

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
Alyssa Rosenzweig
2024-09-22 16:33:35 -04:00
committed by Marge Bot
parent 92d7ecb98c
commit 5bb99b1104
+12
View File
@@ -378,6 +378,18 @@ agx_vec2(agx_builder *b, agx_index s0, agx_index s1)
return agx_emit_collect(b, 2, (agx_index[]){s0, s1});
}
static agx_index
agx_pad_to_32(agx_builder *b, agx_index s)
{
assert(s.size == AGX_SIZE_16);
assert(agx_channels(s) == 1);
agx_index srcs[2] = {s, agx_undef(AGX_SIZE_16)};
agx_index dst = agx_vec_temp(b->shader, AGX_SIZE_32, 1);
agx_emit_collect_to(b, dst, 2, srcs);
return dst;
}
static agx_index
agx_recollect_vector(agx_builder *b, nir_src vec)
{