[Mesa-dev] [PATCH 5/6] main: Added entry point for glGetTransformFeedbacki_v

Martin Peres martin.peres at linux.intel.com
Thu Jan 29 04:55:25 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 |  7 +++++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  1 +
 src/mesa/main/transformfeedback.c              | 29 ++++++++++++++++++++++++++
 src/mesa/main/transformfeedback.h              |  4 ++++
 4 files changed, 41 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 1ac4386..935e088 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -34,6 +34,13 @@
       <param name="param" type="GLint *" />
    </function>
 
+   <function name="GetTransformFeedbacki_v" offset="assign">
+      <param name="xfb" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="index" type="GLuint" />
+      <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 888d34a..4b92699 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -959,6 +959,7 @@ const struct function gl_core_functions_possible[] = {
    { "glTransformFeedbackBufferBase", 45, -1 },
    { "glTransformFeedbackBufferRange", 45, -1 },
    { "glGetTransformFeedbackiv", 45, -1 },
+   { "glGetTransformFeedbacki_v", 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 ae3e1c0..1ffdc16 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -1220,3 +1220,32 @@ _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param)
                    "glGetTransformFeedbackiv(pname=%i)", pname);
     }
 }
+
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
+                              GLint *param)
+{
+   struct gl_transform_feedback_object *obj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   obj = _mesa_lookup_transform_feedback_object_err(ctx, xfb,
+                                                   "glGetTransformFeedbacki_v");
+   if(!obj) {
+      return;
+   }
+
+   if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
+      _mesa_error(ctx, GL_INVALID_VALUE,
+                  "glGetTransformFeedbacki_v(index=%i)", index);
+      return;
+   }
+
+   switch(pname) {
+   case GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:
+      *param = obj->BufferNames[index];
+      break;
+   default:
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "glGetTransformFeedbacki_v(pname=%i)", pname);
+   }
+}
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 4bc7c0c..2c31b22 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -169,4 +169,8 @@ _mesa_TransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer,
 extern void GLAPIENTRY
 _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
 
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
+                              GLint *param);
+
 #endif /* TRANSFORM_FEEDBACK_H */
-- 
2.2.2



More information about the mesa-dev mailing list