From: Nicolai Hähnle Date: Thu, 7 Jan 2016 19:48:27 +0000 (-0500) Subject: mesa/main: add USAGE_PIXEL_PACK_BUFFER flag to buffer UsageHistory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd7229b4374d7bd8f296e1da4123e0d678d67699;p=mesa.git mesa/main: add USAGE_PIXEL_PACK_BUFFER flag to buffer UsageHistory We will want to disable minmax index caching for buffers that are used in this way. Reviewed-by: Ian Romanick Reviewed-by: Marek Olšák --- diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 8ede1f06e4e..8dedc366ef2 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1014,6 +1014,15 @@ bind_buffer_object(struct gl_context *ctx, GLenum target, GLuint buffer) return; } + /* record usage history */ + switch (target) { + case GL_PIXEL_PACK_BUFFER: + newBufObj->UsageHistory |= USAGE_PIXEL_PACK_BUFFER; + break; + default: + break; + } + /* bind new buffer */ _mesa_reference_buffer_object(ctx, bindTarget, newBufObj); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d0fb3367751..4446d94b407 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1254,6 +1254,7 @@ typedef enum { USAGE_ATOMIC_COUNTER_BUFFER = 0x4, USAGE_SHADER_STORAGE_BUFFER = 0x8, USAGE_TRANSFORM_FEEDBACK_BUFFER = 0x10, + USAGE_PIXEL_PACK_BUFFER = 0x20, } gl_buffer_usage;