From: Pierre-Eric Pelloux-Prayer Date: Thu, 2 May 2019 13:01:05 +0000 (+0200) Subject: mesa: add EXT_dsa indexed generic queries X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0ac0e26539eaa4501da2691edab3c183a9634ec;p=mesa.git mesa: add EXT_dsa indexed generic queries Only GetPointerIndexedvEXT needs an implementation, the other functions are aliases of existing functions. --- diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index be1ddbafe59..41fcf1e93b6 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -323,6 +323,24 @@ + + + + + + + + + + + + + + + + + + @@ -496,5 +514,11 @@ + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 4ce68fc01e8..fae79d470d9 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1516,7 +1516,7 @@ offsets = { "GetNamedFramebufferAttachmentParameterivEXT": 1480, "EnableClientStateiEXT": 1481, "DisableClientStateiEXT": 1482, - + "GetPointerIndexedvEXT": 1483, } functions = [ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index f213002d9f8..b32552a9cb8 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2678,8 +2678,6 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) case GL_TEXTURE_BINDING_RECTANGLE: { int target; - if (ctx->API != API_OPENGL_CORE) - goto invalid_enum; target = tex_binding_to_index(ctx, pname); if (target < 0) goto invalid_enum; @@ -2771,6 +2769,16 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v) _mesa_ClientActiveTexture(GL_TEXTURE0 + curTexUnitSave); return TYPE_INT; } + case GL_TEXTURE_MATRIX: + if (index >= ARRAY_SIZE(ctx->TextureMatrixStack)) + goto invalid_enum; + v->value_matrix = ctx->TextureMatrixStack[index].Top; + return TYPE_MATRIX; + case GL_TRANSPOSE_TEXTURE_MATRIX: + if (index >= ARRAY_SIZE(ctx->TextureMatrixStack)) + goto invalid_enum; + v->value_matrix = ctx->TextureMatrixStack[index].Top; + return TYPE_MATRIX_T; } invalid_enum: diff --git a/src/mesa/main/get.h b/src/mesa/main/get.h index 34cb9381fed..898fb49cdb3 100644 --- a/src/mesa/main/get.h +++ b/src/mesa/main/get.h @@ -68,6 +68,9 @@ _mesa_GetInteger64i_v( GLenum pname, GLuint index, GLint64 *params ); extern void GLAPIENTRY _mesa_GetPointerv( GLenum pname, GLvoid **params ); +extern void GLAPIENTRY +_mesa_GetPointerIndexedvEXT( GLenum pname, GLuint index, GLvoid **params ); + extern void GLAPIENTRY _mesa_GetFloati_v(GLenum target, GLuint index, GLfloat *data); diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index e2f5af29b37..bd02b9db0b0 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -328,6 +328,32 @@ invalid_pname: } +void GLAPIENTRY +_mesa_GetPointerIndexedvEXT( GLenum pname, GLuint index, GLvoid **params ) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!params) + return; + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "%s %s\n", "glGetPointerIndexedvEXT", _mesa_enum_to_string(pname)); + + switch (pname) { + case GL_TEXTURE_COORD_ARRAY_POINTER: + *params = (GLvoid *) ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_TEX(index)].Ptr; + break; + default: + goto invalid_pname; + } + + return; + +invalid_pname: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerIndexedvEXT"); + return; +} + /** * Returns the current GL error code, or GL_NO_ERROR. * \return current error code diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index cecca5e0aa9..0702c6de0a3 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1094,7 +1094,7 @@ const struct function common_desktop_functions_possible[] = { //{ "glCopyMultiTexSubImage3DEXT", 12, -1 }, { "glEnableClientStateIndexedEXT", 12, -1 }, { "glDisableClientStateIndexedEXT", 12, -1 }, - //{ "glGetPointerIndexedvEXT", 12, -1 }, + { "glGetPointerIndexedvEXT", 12, -1 }, /* GL_EXT_direct_state_access - ARB_vertex_program */ //{ "glNamedProgramStringEXT", 10, -1 }, //{ "glNamedProgramLocalParameter4dEXT", 10, -1 }, @@ -1185,7 +1185,6 @@ const struct function common_desktop_functions_possible[] = { /* GL_EXT_direct_state_access - GL 3.0 */ //{ "glGetFloati_vEXT", 30, -1 }, //{ "glGetDoublei_vEXT", 30, -1 }, - //{ "glGetPointeri_vEXT", 30, -1 }, //{ "glNamedRenderbufferStorageEXT", 30, -1 }, //{ "glGetNamedRenderbufferParameterivEXT", 30, -1 }, //{ "glNamedRenderbufferStorageMultisampleEXT", 30, -1 },