summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-07-18 21:25:46 +0200
committerSamuel Pitoiset <[email protected]>2017-07-31 13:53:39 +0200
commitbc1c45d0ed56b5b52c965bba928d07b3290a2588 (patch)
treee49571f0735a56e87cb647050bf7a3b47468cc57
parent15603acfd90bd43684bb9e9131f6d59a2d6f5019 (diff)
mesa: add KHR_no_error support to glGenerate*Mipmap()
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mapi/glapi/gen/ARB_direct_state_access.xml2
-rw-r--r--src/mapi/glapi/gen/ARB_framebuffer_object.xml2
-rw-r--r--src/mesa/main/genmipmap.c26
-rw-r--r--src/mesa/main/genmipmap.h6
4 files changed, 34 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 4439c5bcbe0..54276ea59d9 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -514,7 +514,7 @@
<param name="param" type="const GLint *" />
</function>
- <function name="GenerateTextureMipmap">
+ <function name="GenerateTextureMipmap" no_error="true">
<param name="texture" type="GLuint" />
</function>
diff --git a/src/mapi/glapi/gen/ARB_framebuffer_object.xml b/src/mapi/glapi/gen/ARB_framebuffer_object.xml
index b8fff926207..380d4954e64 100644
--- a/src/mapi/glapi/gen/ARB_framebuffer_object.xml
+++ b/src/mapi/glapi/gen/ARB_framebuffer_object.xml
@@ -285,7 +285,7 @@
<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>
diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c
index 9eb83cf85f3..488c32f8101 100644
--- a/src/mesa/main/genmipmap.c
+++ b/src/mesa/main/genmipmap.c
@@ -176,12 +176,29 @@ 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)
{
struct gl_texture_object *texObj;
@@ -204,6 +221,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)
{
struct gl_texture_object *texObj;
diff --git a/src/mesa/main/genmipmap.h b/src/mesa/main/genmipmap.h
index 94f7f7a6809..681c9d9087c 100644
--- a/src/mesa/main/genmipmap.h
+++ b/src/mesa/main/genmipmap.h
@@ -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);