summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-09-25 15:29:56 +0900
committerMichel Dänzer <michel@daenzer.net>2014-09-26 16:53:13 +0900
commit7e55c3b352b6616fa2780f683dd6c8e1a3f61815 (patch)
tree8b7c2338a0d73aa010cda1df2df26e75d969c6f1
parent9caa5c3b130787587c21867c1b5b300d6dee5d5c (diff)
st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers
Such buffers can only be useful by reading from them with the CPU, so we need to make sure CPU reads are fast. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: mesa-stable@lists.freedesktop.org
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index e0cb979f231..d53602c8b5a 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -246,21 +246,23 @@ st_bufferobj_data(struct gl_context *ctx,
/* BufferData */
switch (usage) {
case GL_STATIC_DRAW:
- case GL_STATIC_READ:
case GL_STATIC_COPY:
default:
pipe_usage = PIPE_USAGE_DEFAULT;
break;
case GL_DYNAMIC_DRAW:
- case GL_DYNAMIC_READ:
case GL_DYNAMIC_COPY:
pipe_usage = PIPE_USAGE_DYNAMIC;
break;
case GL_STREAM_DRAW:
- case GL_STREAM_READ:
case GL_STREAM_COPY:
pipe_usage = PIPE_USAGE_STREAM;
break;
+ case GL_STATIC_READ:
+ case GL_DYNAMIC_READ:
+ case GL_STREAM_READ:
+ pipe_usage = PIPE_USAGE_STAGING;
+ break;
}
}