mesa: add EXT_dsa Generate*MipmapEXT functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 11 Sep 2019 08:01:24 +0000 (10:01 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 18 Oct 2019 08:26:26 +0000 (10:26 +0200)
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/genmipmap.c
src/mesa/main/genmipmap.h
src/mesa/main/tests/dispatch_sanity.cpp

index cf4ab86cdd1511b2181135a6d237ea58d3fca38c..b2f27cf2ddef7261905135ecc34da119329ced7a 100644 (file)
       <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" />
index f4ad5da6f3eafb07c4dd792a7b8fa50bc5e9a1f1..95d68a947cb9212c9247eda6b2b19fbeae8c5f10 100644 (file)
@@ -1593,6 +1593,8 @@ offsets = {
     "GetMultiTexParameterIivEXT": 1557,
     "GetMultiTexParameterIuivEXT": 1558,
     "NamedProgramLocalParameters4fvEXT": 1559,
+    "GenerateTextureMipmapEXT": 1560,
+    "GenerateMultiTexMipmapEXT": 1561,
 }
 
 functions = [
index 6729631b16b4282ac1b33bfd3567aa28575fe402..dcbe9675070f6e116ea43d92ae2b4e3eb15cb5fb 100644 (file)
@@ -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");
+}
index 681c9d9087cf39e4aad9e050f914c468abc80034..c661f2184c781014834a7f9f01645da9222039d6 100644 (file)
@@ -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 */
index 920fee4d1e75be90db623c168311b612f8011308..3ff130858942f908e711585c0f30257e82e3c684 100644 (file)
@@ -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 },