[Mesa-dev,2/8] mesa: Add QueryBuffer to context

Submitted by Rafal Mielniczuk on March 19, 2014, 9:30 p.m.

Details

Message ID 1395264650-13479-3-git-send-email-rafal.mielniczuk2@gmail.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Rafal Mielniczuk March 19, 2014, 9:30 p.m.
Add QueryBuffer and initialise it to NullBufferObj
on start

Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2@gmail.com>
---
 src/mesa/main/bufferobj.c | 5 +++++
 src/mesa/main/mtypes.h    | 2 ++
 2 files changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 2e9e059..8d6e1ee 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -89,6 +89,8 @@  get_buffer_target(struct gl_context *ctx, GLenum target)
       return &ctx->CopyReadBuffer;
    case GL_COPY_WRITE_BUFFER:
       return &ctx->CopyWriteBuffer;
+   case GL_QUERY_BUFFER:
+      return &ctx->QueryBuffer;
    case GL_DRAW_INDIRECT_BUFFER:
       if (ctx->API == API_OPENGL_CORE &&
           ctx->Extensions.ARB_draw_indirect) {
@@ -835,6 +837,9 @@  _mesa_init_buffer_objects( struct gl_context *ctx )
    _mesa_reference_buffer_object(ctx, &ctx->DrawIndirectBuffer,
 				 ctx->Shared->NullBufferObj);
 
+   _mesa_reference_buffer_object(ctx, &ctx->QueryBuffer,
+                                 ctx->Shared->NullBufferObj);
+
    for (i = 0; i < MAX_COMBINED_UNIFORM_BUFFERS; i++) {
       _mesa_reference_buffer_object(ctx,
 				    &ctx->UniformBufferBindings[i].BufferObject,
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7c83d66..f6aca22 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4136,6 +4136,8 @@  struct gl_context
    struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */
    struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */
 
+   struct gl_buffer_object *QueryBuffer; /**< GL_ARB_query_buffer_object */
+
    /**
     * Current GL_ARB_uniform_buffer_object binding referenced by
     * GL_UNIFORM_BUFFER target for glBufferData, glMapBuffer, etc.