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

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Nov 17 18:16:14 2021 -0500

mesa/st: make some pbo functions public

Acked-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11984>

---

 src/mesa/state_tracker/st_cb_texture.c | 16 ++++++++--------
 src/mesa/state_tracker/st_pbo.h        |  8 ++++++++
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 950a2242354..273ac249fea 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -129,8 +129,8 @@ gl_target_to_pipe(GLenum target)
    }
 }
 
-static enum pipe_format
-get_src_format(struct pipe_screen *screen, enum pipe_format src_format, struct 
pipe_resource *src)
+enum pipe_format
+st_pbo_get_src_format(struct pipe_screen *screen, enum pipe_format src_format, 
struct pipe_resource *src)
 {
    /* Convert the source format to what is expected by GetTexImage
     * and see if it's supported.
@@ -284,10 +284,10 @@ end:
    return done;
 }
 
-static enum pipe_format
-get_dst_format(struct gl_context *ctx, enum pipe_texture_target target,
-               enum pipe_format src_format, bool is_compressed,
-               GLenum format, GLenum type, unsigned bind)
+enum pipe_format
+st_pbo_get_dst_format(struct gl_context *ctx, enum pipe_texture_target target,
+                      enum pipe_format src_format, bool is_compressed,
+                      GLenum format, GLenum type, unsigned bind)
 {
    struct st_context *st = st_context(ctx);
    struct pipe_screen *screen = st->screen;
@@ -2540,7 +2540,7 @@ st_GetTexSubImage(struct gl_context * ctx,
       goto fallback;
    }
 
-   src_format = get_src_format(screen, stObj->surface_based ? 
stObj->surface_format : src->format, src);
+   src_format = st_pbo_get_src_format(screen, stObj->surface_based ? 
stObj->surface_format : src->format, src);
    if (src_format == PIPE_FORMAT_NONE)
       goto fallback;
 
@@ -2549,7 +2549,7 @@ st_GetTexSubImage(struct gl_context * ctx,
    else
       bind = PIPE_BIND_RENDER_TARGET;
 
-   dst_format = get_dst_format(ctx, pipe_target, src_format, 
util_format_is_compressed(src->format),
+   dst_format = st_pbo_get_dst_format(ctx, pipe_target, src_format, 
util_format_is_compressed(src->format),
                                format, type, bind);
    if (dst_format == PIPE_FORMAT_NONE)
       goto fallback;
diff --git a/src/mesa/state_tracker/st_pbo.h b/src/mesa/state_tracker/st_pbo.h
index 91a50dee325..15df574193d 100644
--- a/src/mesa/state_tracker/st_pbo.h
+++ b/src/mesa/state_tracker/st_pbo.h
@@ -110,6 +110,14 @@ st_pbo_get_download_fs(struct st_context *st, enum 
pipe_texture_target target,
                        enum pipe_format dst_format,
                        bool need_layer);
 
+
+enum pipe_format
+st_pbo_get_dst_format(struct gl_context *ctx, enum pipe_texture_target target,
+                      enum pipe_format src_format, bool is_compressed,
+                      GLenum format, GLenum type, unsigned bind);
+enum pipe_format
+st_pbo_get_src_format(struct pipe_screen *screen, enum pipe_format src_format, 
struct pipe_resource *src);
+
 extern void
 st_init_pbo_helpers(struct st_context *st);
 

Reply via email to