From 6ead10d08f0a4e0ccc699437ed424a0019c07ef8 Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Thu, 22 Jan 2015 16:55:29 +0200 Subject: main: Added entry point for glGetTransformFeedbacki64_v v2: Review from Laura Ekstrand - use the transform feedback object lookup wrapper v3: - use the new name of _mesa_lookup_transform_feedback_object_err v4: Review from Laura Ekstrand - fix some alignement problems Reviewed-by: Laura Ekstrand Signed-off-by: Martin Peres --- 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 89b1c7fd459..51de351816a 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 @@ + + + + + + + diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index c31ce433bb9..e9631628076 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -927,6 +927,7 @@ const struct function gl_core_functions_possible[] = { { "glTransformFeedbackBufferRange", 45, -1 }, { "glGetTransformFeedbackiv", 45, -1 }, { "glGetTransformFeedbacki_v", 45, -1 }, + { "glGetTransformFeedbacki64_v", 45, -1 }, { "glCreateBuffers", 45, -1 }, { "glNamedBufferStorage", 45, -1 }, { "glNamedBufferData", 45, -1 }, diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 4f9dadac9b4..0a6d00cb013 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 631ab2f2e4a..bb9729cdbde 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -163,4 +163,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 */ -- cgit v1.2.3