[Mesa-dev] [PATCH 2/8] mesa: Add QueryBuffer to context
Rafal Mielniczuk
rafal.mielniczuk2 at gmail.com
Wed Mar 19 14:30:44 PDT 2014
Add QueryBuffer and initialise it to NullBufferObj
on start
Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2 at gmail.com>
---
src/mesa/main/bufferobj.c | 5 +++++
src/mesa/main/mtypes.h | 2 ++
2 files changed, 7 insertions(+)
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.
--
1.9.0
More information about the mesa-dev
mailing list