Mesa (master): st/mesa: change st_pbo_create_upload_fs to st_pbo_get_upload_fs

Nicolai Hähnle nh at kemper.freedesktop.org
Wed Nov 16 09:34:11 UTC 2016


Module: Mesa
Branch: master
Commit: 5e10a3d6e5c26ecfb536707165f4baf3b27a7623
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e10a3d6e5c26ecfb536707165f4baf3b27a7623

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Mon Nov  7 17:55:56 2016 +0100

st/mesa: change st_pbo_create_upload_fs to st_pbo_get_upload_fs

For consistency with st_pbo_get_download_fs.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

---

 src/mesa/state_tracker/st_cb_texture.c | 12 +++++-------
 src/mesa/state_tracker/st_pbo.c        |  7 +++++--
 src/mesa/state_tracker/st_pbo.h        |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index fa52a4e..ef59041 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1138,13 +1138,11 @@ try_pbo_upload_common(struct gl_context *ctx,
    struct cso_context *cso = st->cso_context;
    struct pipe_context *pipe = st->pipe;
    bool success = false;
+   void *fs;
 
-   /* Create fragment shader */
-   if (!st->pbo.upload_fs) {
-      st->pbo.upload_fs = st_pbo_create_upload_fs(st);
-      if (!st->pbo.upload_fs)
-         return false;
-   }
+   fs = st_pbo_get_upload_fs(st);
+   if (!fs)
+      return false;
 
    cso_save_state(cso, (CSO_BIT_FRAGMENT_SAMPLER_VIEWS |
                         CSO_BIT_FRAGMENT_SAMPLERS |
@@ -1217,7 +1215,7 @@ try_pbo_upload_common(struct gl_context *ctx,
    }
 
    /* Set up the fragment shader */
-   cso_set_fragment_shader_handle(cso, st->pbo.upload_fs);
+   cso_set_fragment_shader_handle(cso, fs);
 
    success = st_pbo_draw(st, addr, surface->width, surface->height);
 
diff --git a/src/mesa/state_tracker/st_pbo.c b/src/mesa/state_tracker/st_pbo.c
index ca6bdea..1e21554 100644
--- a/src/mesa/state_tracker/st_pbo.c
+++ b/src/mesa/state_tracker/st_pbo.c
@@ -515,9 +515,12 @@ create_fs(struct st_context *st, bool download, enum pipe_texture_target target)
 }
 
 void *
-st_pbo_create_upload_fs(struct st_context *st)
+st_pbo_get_upload_fs(struct st_context *st)
 {
-   return create_fs(st, false, 0);
+   if (!st->pbo.upload_fs)
+      st->pbo.upload_fs = create_fs(st, false, 0);
+
+   return st->pbo.upload_fs;
 }
 
 void *
diff --git a/src/mesa/state_tracker/st_pbo.h b/src/mesa/state_tracker/st_pbo.h
index 17359c4..6513093 100644
--- a/src/mesa/state_tracker/st_pbo.h
+++ b/src/mesa/state_tracker/st_pbo.h
@@ -85,7 +85,7 @@ void *
 st_pbo_create_gs(struct st_context *st);
 
 void *
-st_pbo_create_upload_fs(struct st_context *st);
+st_pbo_get_upload_fs(struct st_context *st);
 
 void *
 st_pbo_get_download_fs(struct st_context *st, enum pipe_texture_target target);




More information about the mesa-commit mailing list