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

2015-02-09 Thread Martin Peres
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 
---
 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 @@
   

 
+   
+  
+  
+  
+  
+   
+

 

diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index ba36d28..d5535e9 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 9c9cba2..ce9a6d4 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 ba00636..9936c68 100644
--- a/src/mesa/main/transformfeedback.h
+++ b/src/mesa/main/transformfeedback.h
@@ -158,4 +158,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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-01-29 Thread Martin Peres
v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

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  | 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 @@
   

 
+   
+  
+  
+  
+  
+   
+

 

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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev