mesa/main: add USAGE_TRANSFORM_FEEDBACK_BUFFER flag to buffer UsageHistory
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Jan 2016 22:38:19 +0000 (17:38 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 3 Feb 2016 13:03:41 +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/mtypes.h
src/mesa/main/transformfeedback.h

index 101283cb1a450faf8c5416f6cd66e28d31cddd12..d0fb33677518d0c6a059a60f50bf749b4edfaaa7 100644 (file)
@@ -1253,6 +1253,7 @@ typedef enum {
    USAGE_TEXTURE_BUFFER = 0x2,
    USAGE_ATOMIC_COUNTER_BUFFER = 0x4,
    USAGE_SHADER_STORAGE_BUFFER = 0x8,
+   USAGE_TRANSFORM_FEEDBACK_BUFFER = 0x10,
 } gl_buffer_usage;
 
 
index bb9729cdbde2c5c20676ae7c3bbce6cf0d2bbc3f..eb274ad65407b4acc9db66ed98e39c9569c7b511 100644 (file)
@@ -145,6 +145,9 @@ _mesa_set_transform_feedback_binding(struct gl_context *ctx,
    tfObj->BufferNames[index]   = bufObj->Name;
    tfObj->Offset[index]        = offset;
    tfObj->RequestedSize[index] = size;
+
+   if (bufObj != ctx->Shared->NullBufferObj)
+      bufObj->UsageHistory |= USAGE_TRANSFORM_FEEDBACK_BUFFER;
 }
 
 /*** GL_ARB_direct_state_access ***/