aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-05-20 14:12:54 +0200
committerMarek Olšák <[email protected]>2019-07-19 20:04:06 -0400
commitff0cafc8f3ae85b9bc604334082da999a0abb2a0 (patch)
treef19875710a65d07843a95636dfebe259d4bb288c /src/mesa/main
parent5fb9c9d628ef4a1ddc3be2e1bbe84fe5387693e7 (diff)
mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functions
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp4
-rw-r--r--src/mesa/main/texparam.c42
-rw-r--r--src/mesa/main/texparam.h9
3 files changed, 53 insertions, 2 deletions
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
@@ -1884,6 +1884,28 @@ _mesa_GetTextureLevelParameterfv(GLuint texture, GLint level,
}
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 );