Mesa (main): pan/gen_macros: Map {TEXTURE,SAMPLER} to the arch-specific descriptor

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 26 08:52:45 UTC 2021


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Wed Jul 28 11:13:39 2021 +0200

pan/gen_macros: Map {TEXTURE,SAMPLER} to the arch-specific descriptor

This will ease the transition to per-arch XML files. While at it, patch
pan_cmdstream.c to use this new macro and avoid an #if section.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12551>

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 6 +-----
 src/panfrost/lib/gen_macros.h                | 4 ++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index d2984443a1a..a793ce9ffbd 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -143,11 +143,7 @@ panfrost_create_sampler_state(
 
         bool using_nearest = cso->min_img_filter == PIPE_TEX_MIPFILTER_NEAREST;
 
-#if PAN_ARCH <= 5
-        pan_pack(&so->hw, MIDGARD_SAMPLER, cfg) {
-#else
-        pan_pack(&so->hw, BIFROST_SAMPLER, cfg) {
-#endif
+        pan_pack(&so->hw, SAMPLER, cfg) {
                 cfg.magnify_nearest = cso->mag_img_filter == PIPE_TEX_FILTER_NEAREST;
                 cfg.minify_nearest = cso->min_img_filter == PIPE_TEX_FILTER_NEAREST;
 
diff --git a/src/panfrost/lib/gen_macros.h b/src/panfrost/lib/gen_macros.h
index c059440510b..1426a9cb1ff 100644
--- a/src/panfrost/lib/gen_macros.h
+++ b/src/panfrost/lib/gen_macros.h
@@ -58,8 +58,12 @@
 
 #if PAN_ARCH >= 6
 #define TILER_JOB BIFROST_TILER_JOB
+#define TEXTURE BIFROST_TEXTURE
+#define SAMPLER BIFROST_SAMPLER
 #else
 #define TILER_JOB MIDGARD_TILER_JOB
+#define TEXTURE MIDGARD_TEXTURE
+#define SAMPLER MIDGARD_SAMPLER
 #endif
 
 /* Suffixing macros */



More information about the mesa-commit mailing list