[Mesa-dev] [RESEND PATCH 3/7] mesa: Mark buffer objects that are used as TexBOs

Chris Forbes chrisf at ijw.co.nz
Wed Oct 1 11:11:24 PDT 2014


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/main/mtypes.h   | 3 +++
 src/mesa/main/teximage.c | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9ac66fe..f040679 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1469,6 +1469,7 @@ struct gl_buffer_mapping {
  */
 typedef enum {
    USAGE_UNIFORM_BUFFER = 0x1,
+   USAGE_TEXTURE_BUFFER = 0x2,
 } gl_buffer_usage;
 
 
@@ -4037,6 +4038,8 @@ struct gl_driver_flags
     */
    uint64_t NewUniformBuffer;
 
+   uint64_t NewTextureBuffer;
+
    /**
     * gl_context::AtomicBufferBindings
     */
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 647d28a..e8dea07 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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;
+   }
 }
 
 
-- 
2.1.1



More information about the mesa-dev mailing list