From f4f9269b66184aedba9ffc690c8f24eaa2285edc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 23 Apr 2023 17:38:40 -0400 Subject: [PATCH] agx: Ensure load_frag_coord has the right sizes In case .x isn't read, it'll be null which has the wrong size and will fail the validation added later in this series. We fix this by padding with sized undefs (something that exists of defined size but undefined value) rather than nothingness (of undefined size). Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 01c87ac6dd2..07b31f7d202 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -636,7 +636,11 @@ static void agx_emit_load_frag_coord(agx_builder *b, agx_index dst, nir_intrinsic_instr *instr) { - agx_index dests[4] = {agx_null()}; + agx_index dests[4]; + + for (unsigned i = 0; i < ARRAY_SIZE(dests); ++i) { + dests[i] = agx_undef(AGX_SIZE_32); + } u_foreach_bit(i, nir_ssa_def_components_read(&instr->dest.ssa)) { agx_index fp32 = agx_temp(b->shader, AGX_SIZE_32);