[Mesa-dev] [PATCH 07/16] main: Added entry point for glGetTransformFeedbackiv

Martin Peres martin.peres at linux.intel.com
Mon Feb 16 06:13:58 PST 2015


v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml |  6 ++++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  1 +
 src/mesa/main/transformfeedback.c              | 25 +++++++++++++++++++++++++
 src/mesa/main/transformfeedback.h              |  3 +++
 4 files changed, 35 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index b3c090f..1ac4386 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -28,6 +28,12 @@
       <param name="size" type="GLsizeiptr" />
    </function>
 
+   <function name="GetTransformFeedbackiv" offset="assign">
+      <param name="xfb" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="param" type="GLint *" />
+   </function>
+
    <!-- Texture object functions -->
 
    <function name="CreateTextures" offset="assign">
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 87f7d6f..ba36d28 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -958,6 +958,7 @@ const struct function gl_core_functions_possible[] = {
    { "glCreateTransformFeedbacks", 45, -1 },
    { "glTransformFeedbackBufferBase", 45, -1 },
    { "glTransformFeedbackBufferRange", 45, -1 },
+   { "glGetTransformFeedbackiv", 45, -1 },
    { "glCreateTextures", 45, -1 },
    { "glTextureStorage1D", 45, -1 },
    { "glTextureStorage2D", 45, -1 },
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
index 2dded21..9c9cba2 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -1203,3 +1203,28 @@ _mesa_ResumeTransformFeedback(void)
    assert(ctx->Driver.ResumeTransformFeedback);
    ctx->Driver.ResumeTransformFeedback(ctx, obj);
 }
+
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param)
+{
+    struct gl_transform_feedback_object *obj;
+    GET_CURRENT_CONTEXT(ctx);
+
+    obj = lookup_transform_feedback_object_err(ctx, xfb,
+                                               "glGetTransformFeedbackiv");
+    if(!obj) {
+       return;
+    }
+
+    switch(pname) {
+    case GL_TRANSFORM_FEEDBACK_PAUSED:
+       *param = obj->Paused;
+       break;
+    case GL_TRANSFORM_FEEDBACK_ACTIVE:
+       *param = obj->Active;
+       break;
+    default:
+       _mesa_error(ctx, GL_INVALID_ENUM,
+                   "glGetTransformFeedbackiv(pname=%i)", pname);
+    }
+}
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 6cad766..ba00636 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -155,4 +155,7 @@ extern void GLAPIENTRY
 _mesa_TransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer,
                                    GLintptr offset, GLsizeiptr size);
 
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
+
 #endif /* TRANSFORM_FEEDBACK_H */
-- 
2.3.0



More information about the mesa-dev mailing list