From f69b573dfc0c7f4e2eab5261fe82861843fc0690 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 1 Nov 2023 15:11:32 +0100 Subject: [PATCH] panfrost: bypass format-table for null-textures We directly look up in the format arrays here to save indirections. But do you know what's even faster than a single indirection? Assigning a compile-time constant! So let's use the newly available pack-helper to pack directly what we want here. Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 58c38ed0d22..cd0061b550e 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1704,8 +1704,7 @@ panfrost_emit_null_texture(struct mali_texture_packed *out) cfg.height = 1; cfg.depth = 1; cfg.array_size = 1; - cfg.format = PAN_ARCH >= 7 ? panfrost_pipe_format_v7[PIPE_FORMAT_NONE].hw - : panfrost_pipe_format_v6[PIPE_FORMAT_NONE].hw; + cfg.format = MALI_PACK_FMT(CONSTANT, 0000, L); #if PAN_ARCH <= 7 cfg.texel_ordering = MALI_TEXTURE_LAYOUT_LINEAR; #endif