From ff0cafc8f3ae85b9bc604334082da999a0abb2a0 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 20 May 2019 14:12:54 +0200 Subject: [PATCH] mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- .../glapi/gen/EXT_direct_state_access.xml | 16 +++++++ src/mapi/glapi/gen/static_data.py | 2 + src/mesa/main/tests/dispatch_sanity.cpp | 4 +- src/mesa/main/texparam.c | 42 +++++++++++++++++++ src/mesa/main/texparam.h | 9 ++++ 5 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index cbbb80805ed..8cb7fac1d85 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -116,6 +116,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index da01b15f1f5..29a80afbe20 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1498,6 +1498,8 @@ offsets = { "TextureParameterfEXT": 1462, "TextureParameterfvEXT": 1463, "GetTextureImageEXT": 1464, + "GetTextureLevelParameterivEXT": 1465, + "GetTextureLevelParameterfvEXT": 1466, } functions = [ diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 607a82e311a..ba5df4b0860 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1048,8 +1048,8 @@ const struct function common_desktop_functions_possible[] = { { "glGetTextureImageEXT", 11, -1 }, { "glGetTextureParameterfvEXT", 11, -1 }, { "glGetTextureParameterivEXT", 11, -1 }, - //{ "glGetTextureLevelParameterfvEXT", 11, -1 }, - //{ "glGetTextureLevelParameterivEXT", 11, -1 }, + { "glGetTextureLevelParameterfvEXT", 11, -1 }, + { "glGetTextureLevelParameterivEXT", 11, -1 }, /* GL_EXT_direct_state_access - GL 1.2 */ { "glTextureImage3DEXT", 12, -1 }, { "glTextureSubImage3DEXT", 12, -1 }, diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 64bd0b63566..f3a01ae65e5 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1883,6 +1883,28 @@ _mesa_GetTextureLevelParameterfv(GLuint texture, GLint level, *params = (GLfloat) iparam; } +void GLAPIENTRY +_mesa_GetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, + GLenum pname, GLfloat *params) +{ + struct gl_texture_object *texObj; + GLint iparam; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true, + "glGetTextureLevelParameterfvEXT"); + if (!texObj) + return; + + if (!valid_tex_level_parameteriv_target(ctx, texObj->Target, true)) + return; + + get_tex_level_parameteriv(ctx, texObj, texObj->Target, level, + pname, &iparam, true); + + *params = (GLfloat) iparam; +} + void GLAPIENTRY _mesa_GetTextureLevelParameteriv(GLuint texture, GLint level, GLenum pname, GLint *params) @@ -1902,6 +1924,26 @@ _mesa_GetTextureLevelParameteriv(GLuint texture, GLint level, pname, params, true); } +void GLAPIENTRY +_mesa_GetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, + GLenum pname, GLint *params) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true, + "glGetTextureLevelParameterivEXT"); + if (!texObj) + return; + + if (!valid_tex_level_parameteriv_target(ctx, texObj->Target, true)) + return; + + get_tex_level_parameteriv(ctx, texObj, texObj->Target, level, + pname, params, true); +} + + /** * This isn't exposed to the rest of the driver because it is a part of the * OpenGL API that is rarely used. diff --git a/src/mesa/main/texparam.h b/src/mesa/main/texparam.h index 130d32f2c76..77cb6ff6584 100644 --- a/src/mesa/main/texparam.h +++ b/src/mesa/main/texparam.h @@ -96,6 +96,15 @@ extern void GLAPIENTRY _mesa_GetTextureLevelParameteriv(GLuint texture, GLint level, GLenum pname, GLint *params); +extern void GLAPIENTRY +_mesa_GetTextureLevelParameterfvEXT(GLuint texture, GLenum target, + GLint level, GLenum pname, + GLfloat *params); + +extern void GLAPIENTRY +_mesa_GetTextureLevelParameterivEXT(GLuint texture, GLenum target, + GLint level, GLenum pname, + GLint *params); extern void GLAPIENTRY _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); -- 2.30.2