mesa: add KHR_no_error support to glGenerate*Mipmap()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Jul 2017 19:25:46 +0000 (21:25 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:39 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/ARB_direct_state_access.xml
src/mapi/glapi/gen/ARB_framebuffer_object.xml
src/mesa/main/genmipmap.c
src/mesa/main/genmipmap.h

index 4439c5bcbe077a09edd60e0efaa30528dc3fec7c..54276ea59d93ca6e4a09094b5031e32e5e7e393b 100644 (file)
       <param name="param" type="const GLint *" />
    </function>
 
-   <function name="GenerateTextureMipmap">
+   <function name="GenerateTextureMipmap" no_error="true">
       <param name="texture" type="GLuint" />
    </function>
 
index b8fff92620722368cacfd11e30222851707d3120..380d4954e640bd1e230180ade00b35b3c27d545e 100644 (file)
         <glx rop="4330"/>
     </function>
 
-    <function name="GenerateMipmap" es2="2.0">
+    <function name="GenerateMipmap" es2="2.0" no_error="true">
         <param name="target" type="GLenum"/>
        <glx rop="4325"/>
     </function>
index 9eb83cf85f3d43dd2bb8253a46def8803882e271..488c32f810158138fc8337d4f1e7ef594823a959 100644 (file)
@@ -176,11 +176,28 @@ generate_texture_mipmap_error(struct gl_context *ctx,
    generate_texture_mipmap(ctx, texObj, target, dsa, false);
 }
 
+static void
+generate_texture_mipmap_no_error(struct gl_context *ctx,
+                                 struct gl_texture_object *texObj,
+                                 GLenum target, bool dsa)
+{
+   generate_texture_mipmap(ctx, texObj, target, dsa, true);
+}
+
 /**
  * Generate all the mipmap levels below the base level.
  * Note: this GL function would be more useful if one could specify a
  * cube face, a set of array slices, etc.
  */
+void GLAPIENTRY
+_mesa_GenerateMipmap_no_error(GLenum target)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_texture_object *texObj = _mesa_get_current_tex_object(ctx, target);
+   generate_texture_mipmap_no_error(ctx, texObj, target, false);
+}
+
 void GLAPIENTRY
 _mesa_GenerateMipmap(GLenum target)
 {
@@ -203,6 +220,15 @@ _mesa_GenerateMipmap(GLenum target)
 /**
  * Generate all the mipmap levels below the base level.
  */
+void GLAPIENTRY
+_mesa_GenerateTextureMipmap_no_error(GLuint texture)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture);
+   generate_texture_mipmap_no_error(ctx, texObj, texObj->Target, true);
+}
+
 void GLAPIENTRY
 _mesa_GenerateTextureMipmap(GLuint texture)
 {
index 94f7f7a68091bc4f8b26a733645a3eb6fe9c79e7..681c9d9087cf39e4aad9e050f914c468abc80034 100644 (file)
@@ -35,9 +35,15 @@ bool
 _mesa_is_valid_generate_texture_mipmap_internalformat(struct gl_context *ctx,
                                                       GLenum internalformat);
 
+void GLAPIENTRY
+_mesa_GenerateMipmap_no_error(GLenum target);
+
 extern void GLAPIENTRY
 _mesa_GenerateMipmap(GLenum target);
 
+void GLAPIENTRY
+_mesa_GenerateTextureMipmap_no_error(GLuint texture);
+
 extern void GLAPIENTRY
 _mesa_GenerateTextureMipmap(GLuint texture);