Module: Mesa
Branch: main
Commit: f69b573dfc0c7f4e2eab5261fe82861843fc0690
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f69b573dfc0c7f4e2eab5261fe82861843fc0690

Author: Erik Faye-Lund <[email protected]>
Date:   Wed Nov  1 15:11:32 2023 +0100

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968>

---

 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

Reply via email to