From c6043e7d54fc48771856a50235f9141b711151f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 5 Aug 2016 23:33:52 +0200 Subject: [PATCH] st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT without READ_BIT (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit v2: keep STAGING for GL_MAP_READ_BIT Reviewed-by: Michel Dänzer --- 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 */ -- 2.7.4