mesa/main: add USAGE_PIXEL_PACK_BUFFER flag to buffer UsageHistory
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Jan 2016 19:48:27 +0000 (14:48 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 3 Feb 2016 13:03:45 +0000 (14:03 +0100)
We will want to disable minmax index caching for buffers that are used in this
way.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/bufferobj.c
src/mesa/main/mtypes.h

index 8ede1f06e4ecfa88156ceb3fe1f9d4779168e776..8dedc366ef2b444a763f67277cb729ad0fedf93b 100644 (file)
@@ -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);
 }
index d0fb33677518d0c6a059a60f50bf749b4edfaaa7..4446d94b4072688de0b70e37b643184dddbcf7e8 100644 (file)
@@ -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;