From 1e45752aaf4ac7d2324d71bda4d2ac34f3abf8bd Mon Sep 17 00:00:00 2001 From: Laura Ekstrand Date: Wed, 11 Feb 2015 16:10:20 -0800 Subject: main: Add entry points for GetNamedBufferParameteri[64]v. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Fredrik Höglund --- 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(+) (limited to 'src') diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 27938c5865a..cb9f285fe83 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 @@ + + + + + + + + + + + + diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index e39ad94f160..4c2cdf491f4 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -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, ¶meter, + "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, ¶meter, + "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 0b77bff8756..6b29ce7a707 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -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); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 3dd075115af..336c41c1095 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -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 }, -- cgit v1.2.3