mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 20 May 2019 12:12:54 +0000 (14:12 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 20 Jul 2019 00:04:06 +0000 (20:04 -0400)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/EXT_direct_state_access.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/texparam.c
src/mesa/main/texparam.h

index cbbb80805ed881abec9d857d2923fe2301243546..8cb7fac1d85f8e8bbb359f41f4290dae946ffe50 100644 (file)
        <param name="params" type="float *" />
     </function>
 
        <param name="params" type="float *" />
     </function>
 
+    <function name="GetTextureLevelParameterivEXT">
+       <param name="texture" type="GLuint" />
+       <param name="target" type="GLenum" />
+       <param name="level" type="GLint" />
+       <param name="pname" type="GLenum" />
+       <param name="params" type="GLint *" />
+    </function>
+
+    <function name="GetTextureLevelParameterfvEXT">
+       <param name="texture" type="GLuint" />
+       <param name="target" type="GLenum" />
+       <param name="level" type="GLint" />
+       <param name="pname" type="GLenum" />
+       <param name="params" type="float *" />
+    </function>
+
     <function name="TextureParameteriEXT">
        <param name="texture" type="GLuint" />
        <param name="target" type="GLenum" />
     <function name="TextureParameteriEXT">
        <param name="texture" type="GLuint" />
        <param name="target" type="GLenum" />
index da01b15f1f5dc13fc4a2fec6de3510d8d5708928..29a80afbe20682d0e4675ed0ec3fcdebbd3bafb6 100644 (file)
@@ -1498,6 +1498,8 @@ offsets = {
     "TextureParameterfEXT": 1462,
     "TextureParameterfvEXT": 1463,
     "GetTextureImageEXT": 1464,
     "TextureParameterfEXT": 1462,
     "TextureParameterfvEXT": 1463,
     "GetTextureImageEXT": 1464,
+    "GetTextureLevelParameterivEXT": 1465,
+    "GetTextureLevelParameterfvEXT": 1466,
 }
 
 functions = [
 }
 
 functions = [
index 607a82e311a750e719ddbfcadcb2b94f7a2fbf68..ba5df4b08600c074529f20cfa915c2ba3695b2dc 100644 (file)
@@ -1048,8 +1048,8 @@ const struct function common_desktop_functions_possible[] = {
    { "glGetTextureImageEXT", 11, -1 },
    { "glGetTextureParameterfvEXT", 11, -1 },
    { "glGetTextureParameterivEXT", 11, -1 },
    { "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 },
    /* GL_EXT_direct_state_access - GL 1.2 */
    { "glTextureImage3DEXT", 12, -1 },
    { "glTextureSubImage3DEXT", 12, -1 },
index 64bd0b63566e6320ca0fedee63f9d21bf49e2eb8..f3a01ae65e56daac50514f8a1c1d7cd4235e9006 100644 (file)
@@ -1883,6 +1883,28 @@ _mesa_GetTextureLevelParameterfv(GLuint texture, GLint level,
    *params = (GLfloat) iparam;
 }
 
    *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)
 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);
 }
 
                              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.
 /**
  * This isn't exposed to the rest of the driver because it is a part of the
  * OpenGL API that is rarely used.
index 130d32f2c761e1b0b02ac268b9eb4e06c541f862..77cb6ff6584c9add92e49ee0e5bd47ebd20397c0 100644 (file)
@@ -96,6 +96,15 @@ extern void GLAPIENTRY
 _mesa_GetTextureLevelParameteriv(GLuint texture, GLint level,
                                  GLenum pname, GLint *params);
 
 _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 );
 
 extern void GLAPIENTRY
 _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params );