aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-07-08 15:59:17 -0400
committerAlyssa Rosenzweig <[email protected]>2020-07-09 12:49:13 -0400
commit5247d6730223a400aed9068db8a82c134c655005 (patch)
tree301a7ee6c02472bb0c429f21d8f2c15907a16cde /src/gallium/drivers
parent816af26f027ebe325bcaaa70ad1eb9575cddea9f (diff)
panfrost: Move panfrost_translate_texture_type
We need it in pan_job.c Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c26
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.h27
2 files changed, 27 insertions, 26 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 52f0b8f3c7e..d55cbd098db 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -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,
diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h
index bc4e0dbb6c4..baf7604b4f6 100644
--- a/src/gallium/drivers/panfrost/pan_resource.h
+++ b/src/gallium/drivers/panfrost/pan_resource.h
@@ -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 */