[Mesa-dev] [PATCH 20/23] main: Add entry points for GetBufferParameteri[64]v.

Fredrik Höglund fredrik at kde.org
Mon Mar 16 13:07:40 PDT 2015


The commit message should say NamedBufferParameter.

With that fixed, this patch is:

Reviewed-by: Fredrik Höglund <fredrik at kde.org>

On Thursday 12 February 2015, Laura Ekstrand wrote:
> ---
>  src/mapi/glapi/gen/ARB_direct_state_access.xml | 12 ++++++++
>  src/mesa/main/bufferobj.c                      | 39 ++++++++++++++++++++++++++
>  src/mesa/main/bufferobj.h                      |  7 +++++
>  src/mesa/main/tests/dispatch_sanity.cpp        |  2 ++
>  4 files changed, 60 insertions(+)
> 
> diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
> index 27938c5..cb9f285 100644
> --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
> +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
> @@ -86,6 +86,18 @@
>        <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">
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index dfeda21..40da6f5 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -1978,6 +1978,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)
> diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
> index 0b77bff..6b29ce7 100644
> --- a/src/mesa/main/bufferobj.h
> +++ b/src/mesa/main/bufferobj.h
> @@ -268,6 +268,13 @@ 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);
>  
>  void GLAPIENTRY
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
> index dc6c257..b5c9fe5 100644
> --- a/src/mesa/main/tests/dispatch_sanity.cpp
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> @@ -966,6 +966,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 },
> 



More information about the mesa-dev mailing list