[Mesa-dev] [PATCH] st/mesa: use PIPE_USAGE_STREAM for GL_CLIENT_STORAGE_BIT

Fredrik Höglund fredrik at kde.org
Sat Aug 6 20:02:32 UTC 2016


On Saturday 06 August 2016, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> STAGING is mainly for fast CPU reads and random access. I don't think
> glBufferStorage(GL_CLIENT_STORAGE_BIT) is used for those two purposes.
> I'd say GL_CLIENT_STORAGE_BIT is more of a streaming-upload kind of thing.

I'd say it depends on whether it's combined with GL_MAP_READ_BIT or not.

Fredrik

> ---
>  src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
> index 6d54326..232288e 100644
> --- a/src/mesa/state_tracker/st_cb_bufferobjects.c
> +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
> @@ -242,21 +242,21 @@ st_bufferobj_data(struct gl_context *ctx,
>        bind = PIPE_BIND_QUERY_BUFFER;
>        break;
>     default:
>        bind = 0;
>     }
>  
>     /* Set usage. */
>     if (st_obj->Base.Immutable) {
>        /* BufferStorage */
>        if (storageFlags & GL_CLIENT_STORAGE_BIT)
> -         pipe_usage = PIPE_USAGE_STAGING;
> +         pipe_usage = PIPE_USAGE_STREAM;
>        else
>           pipe_usage = PIPE_USAGE_DEFAULT;
>     }
>     else {
>        /* BufferData */
>        switch (usage) {
>        case GL_STATIC_DRAW:
>        case GL_STATIC_COPY:
>        default:
>  	 pipe_usage = PIPE_USAGE_DEFAULT;
> 



More information about the mesa-dev mailing list