Mesa (staging/18.3): mesa/main: check cube-completeness in common code
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Nov 26 16:09:45 UTC 2018
Module: Mesa
Branch: staging/18.3
Commit: 7d8a9087ae8902acfa87bd51f025fc39d43a99e7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d8a9087ae8902acfa87bd51f025fc39d43a99e7
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Thu Nov 22 17:40:47 2018 +0100
mesa/main: check cube-completeness in common code
This check is the only part of dimensions_error_check that isn't about
error-checking the offset and size arguments of
glGet[Compressed]TextureSubImage(), so it doesn't really belong in here.
This doesn't make a difference right now, apart for changing the
presedence of this error. But it will make a difference for the next
patch, where we no longer call this method from the non-sub tex-image
getters.
Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Juan A. Suarez <jasuarez at igalia.com>
(cherry picked from commit 38af69adfaf47019926bfe3a8cf352752068d389)
---
src/mesa/main/texgetimage.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 792535c324..1876efc131 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -981,21 +981,6 @@ dimensions_error_check(struct gl_context *ctx,
"%s(zoffset + depth = %d)", caller, zoffset + depth);
return true;
}
- /* According to OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries"):
- *
- * "An INVALID_OPERATION error is generated by GetTextureImage if the
- * effective target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY ,
- * and the texture object is not cube complete or cube array complete,
- * respectively."
- *
- * This applies also to GetTextureSubImage, GetCompressedTexImage,
- * GetCompressedTextureImage, and GetnCompressedTexImage.
- */
- if (!_mesa_cube_complete(texObj)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(cube incomplete)", caller);
- return true;
- }
break;
default:
; /* nothing */
@@ -1242,6 +1227,22 @@ common_error_check(struct gl_context *ctx,
return true;
}
+ /* According to OpenGL 4.6 spec, section 8.11.4 ("Texture Image Queries"):
+ *
+ * "An INVALID_OPERATION error is generated by GetTextureImage if the
+ * effective target is TEXTURE_CUBE_MAP or TEXTURE_CUBE_MAP_ARRAY ,
+ * and the texture object is not cube complete or cube array complete,
+ * respectively."
+ *
+ * This applies also to GetTextureSubImage, GetCompressedTexImage,
+ * GetCompressedTextureImage, and GetnCompressedTexImage.
+ */
+ if (target == GL_TEXTURE_CUBE_MAP && !_mesa_cube_complete(texObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(cube incomplete)", caller);
+ return true;
+ }
+
return false;
}
More information about the mesa-commit
mailing list