[Mesa-dev] [PATCH 04/10] mesa/main: add USAGE_PIXEL_PACK_BUFFER flag to buffer UsageHistory

Nicolai Hähnle nhaehnle at gmail.com
Mon Jan 11 18:32:41 PST 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

We will want to disable minmax index caching for buffers that are used in this
way.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 src/mesa/main/bufferobj.c | 9 +++++++++
 src/mesa/main/mtypes.h    | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 14ee8c8..3c69777 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 7c6341c..36d37c5 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;
 
 
-- 
2.5.0



More information about the mesa-dev mailing list