From 5fb9159eb97e439e67145107b11512a66fe86cc8 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 24 Jul 2021 14:39:44 -0400 Subject: [PATCH] agx: Fix mismatched units in load_ubo Fixes assertion failure in dEQP-GLES3.functional.ubo.single_basic_type.shared.highp_float_fragment Assertion failed: ((value & 1) == 0), function agx_print_sized, file ../src/asahi/compiler/agx_print.c, line 39. Fixes: 033d4d09fc7 ("agx: Implement load_ubo/kernel_input") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 64b28f8..7ac264f 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -288,10 +288,12 @@ agx_emit_load_ubo(agx_builder *b, nir_intrinsic_instr *instr) /* Each UBO has a 64-bit = 4 x 16-bit address */ unsigned num_ubos = b->shader->nir->info.num_ubos; unsigned base_length = (num_ubos * 4); + unsigned index = block * 4; /* 16 bit units */ /* Lookup the base address (TODO: indirection) */ agx_index base = agx_indexed_sysval(b->shader, - AGX_PUSH_UBO_BASES, AGX_SIZE_64, block, base_length); + AGX_PUSH_UBO_BASES, AGX_SIZE_64, + index, base_length); /* Load the data */ assert(instr->num_components <= 4); -- 2.7.4