panfrost: Move panfrost_translate_texture_type
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 8 Jul 2020 19:59:17 +0000 (15:59 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 9 Jul 2020 16:49:13 +0000 (12:49 -0400)
We need it in pan_job.c

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>

src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_resource.h

index 52f0b8f3c7ee4896d964faef7de73c30e785f55c..d55cbd098dbe8180a57e4aac2f76e254c8256dc1 100644 (file)
@@ -885,32 +885,6 @@ panfrost_set_stencil_ref(
         ctx->stencil_ref = *ref;
 }
 
-static enum mali_texture_type
-panfrost_translate_texture_type(enum pipe_texture_target t) {
-        switch (t)
-        {
-        case PIPE_BUFFER:
-        case PIPE_TEXTURE_1D:
-        case PIPE_TEXTURE_1D_ARRAY:
-                return MALI_TEX_1D;
-
-        case PIPE_TEXTURE_2D:
-        case PIPE_TEXTURE_2D_ARRAY:
-        case PIPE_TEXTURE_RECT:
-                return MALI_TEX_2D;
-
-        case PIPE_TEXTURE_3D:
-                return MALI_TEX_3D;
-
-        case PIPE_TEXTURE_CUBE:
-        case PIPE_TEXTURE_CUBE_ARRAY:
-                return MALI_TEX_CUBE;
-
-        default:
-                unreachable("Unknown target");
-        }
-}
-
 void
 panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
                                 struct pipe_context *pctx,
index bc4e0dbb6c4da37e2035658466752da7f15dbfbf..baf7604b4f6955e812929caac5ff73d51e628032 100644 (file)
@@ -126,4 +126,31 @@ panfrost_resource_set_damage_region(struct pipe_screen *screen,
                                     unsigned int nrects,
                                     const struct pipe_box *rects);
 
+static inline enum mali_texture_type
+panfrost_translate_texture_type(enum pipe_texture_target t) {
+        switch (t)
+        {
+        case PIPE_BUFFER:
+        case PIPE_TEXTURE_1D:
+        case PIPE_TEXTURE_1D_ARRAY:
+                return MALI_TEX_1D;
+
+        case PIPE_TEXTURE_2D:
+        case PIPE_TEXTURE_2D_ARRAY:
+        case PIPE_TEXTURE_RECT:
+                return MALI_TEX_2D;
+
+        case PIPE_TEXTURE_3D:
+                return MALI_TEX_3D;
+
+        case PIPE_TEXTURE_CUBE:
+        case PIPE_TEXTURE_CUBE_ARRAY:
+                return MALI_TEX_CUBE;
+
+        default:
+                unreachable("Unknown target");
+        }
+}
+
+
 #endif /* PAN_RESOURCE_H */