diff options
author | Martin Peres <[email protected]> | 2015-02-16 16:13:59 +0200 |
---|---|---|
committer | Martin Peres <[email protected]> | 2015-03-25 10:05:45 +0200 |
commit | 8799ecddb680f908b719df531dfe740e056ccb77 (patch) | |
tree | 4a80134849cefcbf8eed349add881ea397ea1186 /src | |
parent | e59d2434a075176ebc94438f81d742e222da3e82 (diff) |
main: Added entry point for glGetTransformFeedbacki_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
Reviewed-by: Laura Ekstrand <[email protected]>
Signed-off-by: Martin Peres <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/ARB_direct_state_access.xml | 7 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 1 | ||||
-rw-r--r-- | src/mesa/main/transformfeedback.c | 29 | ||||
-rw-r--r-- | src/mesa/main/transformfeedback.h | 4 |
4 files changed, 41 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 341181ef2bb..89b1c7fd459 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> + <!-- Buffer object functions --> <function name="CreateBuffers" offset="assign"> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index be22fe704c3..c31ce433bb9 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -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 }, diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 0900d411b91..4f9dadac9b4 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -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); + } +} diff --git a/src/mesa/main/transformfeedback.h b/src/mesa/main/transformfeedback.h index af7d5683eef..631ab2f2e4a 100644 --- a/src/mesa/main/transformfeedback.h +++ b/src/mesa/main/transformfeedback.h @@ -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 */ |