From 5577aebfb2af090f35ea02e85cc431186a979289 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 4 Aug 2023 09:41:32 -0400 Subject: [PATCH] agx: Allow more varying slots Don't overflow. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index 277ba155aae..6ca82add275 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -9,6 +9,9 @@ #include "compiler/nir/nir.h" #include "util/u_dynarray.h" +/* 32 user varyings + some system values */ +#define AGX_MAX_VARYING_SLOTS (48) + struct agx_varyings_vs { /* The number of user varyings of each type. The varyings must be allocated * in this order ({smooth, flat, linear} × {32, 16}), which may require @@ -39,13 +42,13 @@ struct agx_varyings_vs { * * If the slot is not written, this must be ~0. */ - unsigned slots[VARYING_SLOT_MAX]; + unsigned slots[AGX_MAX_VARYING_SLOTS]; }; /* Conservative bound, * 4 due to offsets (TODO: maybe worth eliminating * coefficient register aliasing?) */ -#define AGX_MAX_CF_BINDINGS (VARYING_SLOT_MAX * 4) +#define AGX_MAX_CF_BINDINGS (AGX_MAX_VARYING_SLOTS * 4) struct agx_varyings_fs { /* Number of coefficient registers used */