From f6ee36a43731a074b643c6685142484a02a4ab67 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 21 Apr 2025 12:20:19 -0400 Subject: [PATCH] agx: add agx_is_shader_empty helper Signed-off-by: Alyssa Rosenzweig Reviewed-by: Mary Guillemard Part-of: --- src/asahi/compiler/agx_compile.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/asahi/compiler/agx_compile.h b/src/asahi/compiler/agx_compile.h index 92857285c67..97503d3bac9 100644 --- a/src/asahi/compiler/agx_compile.h +++ b/src/asahi/compiler/agx_compile.h @@ -198,6 +198,15 @@ struct agx_shader_part { void *binary; }; +static inline bool +agx_is_shader_empty(struct agx_shader_part *s) +{ + /* Last instruction is a stop, so if there's one instruction, there is + * nothing but a stop. The shader is thus empty. + */ + return (s->info.stats.instrs == 1); +} + #define AGX_MAX_RTS (8) enum agx_format {