main: Added entry point for glGetTransformFeedbacki_v
authorMartin Peres <martin.peres@linux.intel.com>
Mon, 16 Feb 2015 14:13:59 +0000 (16:13 +0200)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 25 Mar 2015 08:05:45 +0000 (10:05 +0200)
v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/transformfeedback.c
src/mesa/main/transformfeedback.h

index 341181ef2bbc1797b38541094191e621e684296d..89b1c7fd459dd8f0d72b1382315465656356d31d 100644 (file)
       <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>
+
    <!-- Buffer object functions -->
 
    <function name="CreateBuffers" offset="assign">
index be22fe704c3abf2e0853daabe4763ca88912ca45..c31ce433bb906a8cdd3ba5833718b49275d796c2 100644 (file)
@@ -926,6 +926,7 @@ const struct function gl_core_functions_possible[] = {
    { "glTransformFeedbackBufferBase", 45, -1 },
    { "glTransformFeedbackBufferRange", 45, -1 },
    { "glGetTransformFeedbackiv", 45, -1 },
+   { "glGetTransformFeedbacki_v", 45, -1 },
    { "glCreateBuffers", 45, -1 },
    { "glNamedBufferStorage", 45, -1 },
    { "glNamedBufferData", 45, -1 },
index 0900d411b91b8dc53c5036f7e04fd956c606576e..4f9dadac9b42f0b323038a41635b13c16c6d4fd7 100644 (file)
@@ -1228,3 +1228,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 = 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);
+   }
+}
index af7d5683eeff407b20e2c5b582ab1ad91e3438df..631ab2f2e4a4e7dafd7d570098956faebb12eee9 100644 (file)
@@ -159,4 +159,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 */