main: Add entry points for GetNamedBufferParameteri[64]v.
authorLaura Ekstrand <laura@jlekstrand.net>
Thu, 12 Feb 2015 00:10:20 +0000 (16:10 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Mar 2015 17:18:34 +0000 (10:18 -0700)
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/tests/dispatch_sanity.cpp

index 27938c5865a2c341042ede24a88dbaf67cc72621..cb9f285fe83a34b0b8da8e6b98b4d9f9d02e9e43 100644 (file)
       <param name="length" type="GLsizeiptr" />
    </function>
 
+   <function name="GetNamedBufferParameteriv" offset="assign">
+      <param name="buffer" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLint *" />
+   </function>
+
+   <function name="GetNamedBufferParameteri64v" offset="assign">
+      <param name="buffer" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLint64 *" />
+   </function>
+
    <!-- Texture object functions -->
 
    <function name="CreateTextures" offset="assign">
index e39ad94f160c77046952b5c82a9ee705e140bcdf..4c2cdf491f42821b721cd94ad29df7f1988d96a8 100644 (file)
@@ -2007,6 +2007,45 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
    *params = parameter;
 }
 
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *bufObj;
+   GLint64 parameter;
+
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer,
+                                       "glGetNamedBufferParameteriv");
+   if (!bufObj)
+      return;
+
+   if (!get_buffer_parameter(ctx, bufObj, pname, &parameter,
+                             "glGetNamedBufferParameteriv"))
+      return; /* Error already recorded. */
+
+   *params = (GLint) parameter;
+}
+
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname,
+                                  GLint64 *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_buffer_object *bufObj;
+   GLint64 parameter;
+
+   bufObj = _mesa_lookup_bufferobj_err(ctx, buffer,
+                                       "glGetNamedBufferParameteri64v");
+   if (!bufObj)
+      return;
+
+   if (!get_buffer_parameter(ctx, bufObj, pname, &parameter,
+                             "glGetNamedBufferParameteri64v"))
+      return; /* Error already recorded. */
+
+   *params = parameter;
+}
+
 
 void GLAPIENTRY
 _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params)
index 0b77bff87564e5a1cbc4b19ef3c7088cd82a90fd..6b29ce7a707267583f1ef1c0e68023bb6687faf9 100644 (file)
@@ -267,6 +267,13 @@ _mesa_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params);
 void GLAPIENTRY
 _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
 
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint *params);
+
+void GLAPIENTRY
+_mesa_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname,
+                                  GLint64 *params);
+
 void GLAPIENTRY
 _mesa_GetBufferPointerv(GLenum target, GLenum pname, GLvoid **params);
 
index 3dd075115afbf212f294153297397b336c8a2741..336c41c1095f918bb58e7450843bbcb5fc0048f5 100644 (file)
@@ -964,6 +964,8 @@ const struct function gl_core_functions_possible[] = {
    { "glMapNamedBufferRange", 45, -1 },
    { "glUnmapNamedBuffer", 45, -1 },
    { "glFlushMappedNamedBufferRange", 45, -1 },
+   { "glGetNamedBufferParameteriv", 45, -1 },
+   { "glGetNamedBufferParameteri64v", 45, -1 },
    { "glCreateTextures", 45, -1 },
    { "glTextureStorage1D", 45, -1 },
    { "glTextureStorage2D", 45, -1 },