Mesa (master): mesa: add EXT_dsa Generate*MipmapEXT functions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 18 08:59:34 UTC 2019


Module: Mesa
Branch: master
Commit: 2e14749f8f82cba47ff89432cafd9fd9bee70e82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e14749f8f82cba47ff89432cafd9fd9bee70e82

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Wed Sep 11 10:01:24 2019 +0200

mesa: add EXT_dsa Generate*MipmapEXT functions

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mapi/glapi/gen/EXT_direct_state_access.xml | 10 ++++++++++
 src/mapi/glapi/gen/static_data.py              |  2 ++
 src/mesa/main/genmipmap.c                      | 27 ++++++++++++++++++++++++++
 src/mesa/main/genmipmap.h                      |  6 ++++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  4 ++--
 5 files changed, 47 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 cf4ab86cdd1..b2f27cf2dde 100644
--- a/src/mapi/glapi/gen/EXT_direct_state_access.xml
+++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml
@@ -1026,6 +1026,16 @@
       <param name="params" type="GLdouble*" />
    </function>
 
+   <function name="GenerateTextureMipmapEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+   </function>
+
+   <function name="GenerateMultiTexMipmapEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+   </function>
+
    <!-- ARB_vertex_program -->
    <function name="NamedProgramStringEXT">
       <param name="program" type="GLuint" />
diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py
index f4ad5da6f3e..95d68a947cb 100644
--- a/src/mapi/glapi/gen/static_data.py
+++ b/src/mapi/glapi/gen/static_data.py
@@ -1593,6 +1593,8 @@ offsets = {
     "GetMultiTexParameterIivEXT": 1557,
     "GetMultiTexParameterIuivEXT": 1558,
     "NamedProgramLocalParameters4fvEXT": 1559,
+    "GenerateTextureMipmapEXT": 1560,
+    "GenerateMultiTexMipmapEXT": 1561,
 }
 
 functions = [
diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c
index 6729631b16b..dcbe9675070 100644
--- a/src/mesa/main/genmipmap.c
+++ b/src/mesa/main/genmipmap.c
@@ -240,3 +240,30 @@ _mesa_GenerateTextureMipmap(GLuint texture)
    texObj = _mesa_lookup_texture_err(ctx, texture, "glGenerateTextureMipmap");
    validate_params_and_generate_mipmap(texObj, "glGenerateTextureMipmap");
 }
+
+void GLAPIENTRY
+_mesa_GenerateTextureMipmapEXT(GLuint texture, GLenum target)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture,
+                                           false, true,
+                                           "glGenerateTextureMipmapEXT");
+   validate_params_and_generate_mipmap(texObj,
+                                       "glGenerateTextureMipmapEXT");
+}
+
+void GLAPIENTRY
+_mesa_GenerateMultiTexMipmapEXT(GLenum texunit, GLenum target)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glGenerateMultiTexMipmapEXT");
+   validate_params_and_generate_mipmap(texObj,
+                                       "glGenerateMultiTexMipmapEXT");
+}
diff --git a/src/mesa/main/genmipmap.h b/src/mesa/main/genmipmap.h
index 681c9d9087c..c661f2184c7 100644
--- a/src/mesa/main/genmipmap.h
+++ b/src/mesa/main/genmipmap.h
@@ -47,4 +47,10 @@ _mesa_GenerateTextureMipmap_no_error(GLuint texture);
 extern void GLAPIENTRY
 _mesa_GenerateTextureMipmap(GLuint texture);
 
+extern void GLAPIENTRY
+_mesa_GenerateTextureMipmapEXT(GLuint texture, GLenum target);
+
+extern void GLAPIENTRY
+_mesa_GenerateMultiTexMipmapEXT(GLenum texunit, GLenum target);
+
 #endif /* GENMIPMAP_H */
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 920fee4d1e7..3ff13085894 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -1162,8 +1162,8 @@ const struct function common_desktop_functions_possible[] = {
    { "glNamedFramebufferTexture3DEXT", 30, -1 },
    { "glNamedFramebufferRenderbufferEXT", 30, -1 },
    { "glGetNamedFramebufferAttachmentParameterivEXT", 30, -1 },
-   //{ "glGenerateTextureMipmapEXT", 30, -1 },
-   //{ "glGenerateMultiTexMipmapEXT", 30, -1 },
+   { "glGenerateTextureMipmapEXT", 30, -1 },
+   { "glGenerateMultiTexMipmapEXT", 30, -1 },
    { "glFramebufferDrawBufferEXT", 30, -1 },
    { "glFramebufferDrawBuffersEXT", 30, -1 },
    { "glFramebufferReadBufferEXT", 30, -1 },




More information about the mesa-commit mailing list