Mesa (master): st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT without READ_BIT (v2)

Marek Olšák mareko at kemper.freedesktop.org
Tue Aug 9 23:32:09 UTC 2016


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Fri Aug  5 23:33:52 2016 +0200

st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT without READ_BIT (v2)

v2: keep STAGING for GL_MAP_READ_BIT

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/mesa/state_tracker/st_cb_bufferobjects.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 6d54326..2f56a55 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -248,10 +248,14 @@ st_bufferobj_data(struct gl_context *ctx,
    /* Set usage. */
    if (st_obj->Base.Immutable) {
       /* BufferStorage */
-      if (storageFlags & GL_CLIENT_STORAGE_BIT)
-         pipe_usage = PIPE_USAGE_STAGING;
-      else
+      if (storageFlags & GL_CLIENT_STORAGE_BIT) {
+         if (storageFlags & GL_MAP_READ_BIT)
+            pipe_usage = PIPE_USAGE_STAGING;
+         else
+            pipe_usage = PIPE_USAGE_STREAM;
+      } else {
          pipe_usage = PIPE_USAGE_DEFAULT;
+      }
    }
    else {
       /* BufferData */




More information about the mesa-commit mailing list