mesa: Mark buffer objects that are used as TexBOs
authorChris Forbes <chrisf@ijw.co.nz>
Wed, 1 Oct 2014 07:04:37 +0000 (20:04 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 16 Oct 2014 09:31:43 +0000 (22:31 +1300)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/main/mtypes.h
src/mesa/main/teximage.c

index 881c26ca3bc05529abcde035f5fa0364c1b023bc..2a01508ed6b6e442559de8deb3c4cab3ecf81d98 100644 (file)
@@ -1469,6 +1469,7 @@ struct gl_buffer_mapping {
  */
 typedef enum {
    USAGE_UNIFORM_BUFFER = 0x1,
+   USAGE_TEXTURE_BUFFER = 0x2,
 } gl_buffer_usage;
 
 
@@ -4069,6 +4070,8 @@ struct gl_driver_flags
     */
    uint64_t NewUniformBuffer;
 
+   uint64_t NewTextureBuffer;
+
    /**
     * gl_context::AtomicBufferBindings
     */
index c0298af8ea61d39210fc61c849a1f6de62a57f35..4f4bb11dd5cef5655816a68980ae2005f8cae727 100644 (file)
@@ -4652,6 +4652,12 @@ texbufferrange(struct gl_context *ctx, GLenum target, GLenum internalFormat,
       texObj->BufferSize = size;
    }
    _mesa_unlock_texture(ctx, texObj);
+
+   ctx->NewDriverState |= ctx->DriverFlags.NewTextureBuffer;
+
+   if (bufObj) {
+      bufObj->UsageHistory |= USAGE_TEXTURE_BUFFER;
+   }
 }