From: Marek Olšák Date: Fri, 5 Aug 2016 21:33:52 +0000 (+0200) Subject: st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT without READ_BIT (v2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c6043e7d54fc48771856a50235f9141b711151f3;p=mesa.git 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 --- 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 */