pan/gen_macros: Map {TEXTURE,SAMPLER} to the arch-specific descriptor
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 28 Jul 2021 09:13:39 +0000 (11:13 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 26 Aug 2021 08:35:17 +0000 (10:35 +0200)
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@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12551>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/panfrost/lib/gen_macros.h

index d298444..a793ce9 100644 (file)
@@ -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;
 
index c059440..1426a9c 100644 (file)
 
 #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 */