[Mesa-dev] [PATCH 09/16] main: Added entry point for glGetTransformFeedbacki64_v

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


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

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

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              | 32 ++++++++++++++++++++++++++
 src/mesa/main/transformfeedback.h              |  4 ++++
 4 files changed, 44 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 935e088..340dbba 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -41,6 +41,13 @@
       <param name="param" type="GLint *" />
    </function>
 
+   <function name="GetTransformFeedbacki64_v" offset="assign">
+      <param name="xfb" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="index" type="GLuint" />
+      <param name="param" type="GLint64 *" />
+   </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 d5535e9..ad5da83 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -960,6 +960,7 @@ const struct function gl_core_functions_possible[] = {
    { "glTransformFeedbackBufferRange", 45, -1 },
    { "glGetTransformFeedbackiv", 45, -1 },
    { "glGetTransformFeedbacki_v", 45, -1 },
+   { "glGetTransformFeedbacki64_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 ce9a6d4..0b6d04b 100644
--- a/src/mesa/main/transformfeedback.c
+++ b/src/mesa/main/transformfeedback.c
@@ -1257,3 +1257,35 @@ _mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
                   "glGetTransformFeedbacki_v(pname=%i)", pname);
    }
 }
+
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index,
+                              GLint64 *param)
+{
+   struct gl_transform_feedback_object *obj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   obj = lookup_transform_feedback_object_err(ctx, xfb,
+                                              "glGetTransformFeedbacki64_v");
+   if(!obj) {
+      return;
+   }
+
+   if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
+      _mesa_error(ctx, GL_INVALID_VALUE,
+                  "glGetTransformFeedbacki64_v(index=%i)", index);
+      return;
+   }
+
+   switch(pname) {
+   case GL_TRANSFORM_FEEDBACK_BUFFER_START:
+      *param = obj->Offset[index];
+      break;
+   case GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:
+      *param = obj->RequestedSize[index];
+      break;
+   default:
+      _mesa_error(ctx, GL_INVALID_ENUM,
+                  "glGetTransformFeedbacki64_v(pname=%i)", pname);
+   }
+}
diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h
index 9936c68..3d21779 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -162,4 +162,8 @@ extern void GLAPIENTRY
 _mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
                               GLint *param);
 
+extern void GLAPIENTRY
+_mesa_GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index,
+                              GLint64 *param);
+
 #endif /* TRANSFORM_FEEDBACK_H */
-- 
2.3.0



More information about the mesa-dev mailing list