[Mesa-dev] [PATCH] st/mesa: Use PIPE_USAGE_STAGING for GL_STATIC/DYNAMIC/STREAM_READ buffers
Marek Olšák
maraeo at gmail.com
Thu Sep 25 05:25:44 PDT 2014
Looks good.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Thu, Sep 25, 2014 at 8:31 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Such buffers can only be useful by reading from them with the CPU, so we
> need to make sure CPU reads are fast.
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
> src/mesa/state_tracker/st_cb_bufferobjects.c | 8 +++++---
> 1 file 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 e0cb979..d53602c 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;
> }
> }
>
> --
> 2.1.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list