summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-08-05 23:33:52 +0200
committerMarek Olšák <[email protected]>2016-08-10 01:11:10 +0200
commitc6043e7d54fc48771856a50235f9141b711151f3 (patch)
treede9f21cc528aef90223243eec8a5a2fa1b6650aa /src
parent33a9b4e8a11f263e5ec43a461279ef00220dcd92 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c10
1 files 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 6d54326d1a0..2f56a55301d 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 */