Mesa (master): mesa: Fix error in target validation of glCompressedTex( ture)SubImage3D() calls

Eduardo Lima Mitev elima at kemper.freedesktop.org
Thu Jul 23 14:32:59 UTC 2015


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

Author: Eduardo Lima Mitev <elima at igalia.com>
Date:   Thu Jul 23 16:25:21 2015 +0200

mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls

Basically, two different target error checks are chained consecutively, and the
second one is executed regardless the result of the first one. This produces an
incorrect error if the first check fails but is overrided by the second.

This patch conditions the execution of the second check to a successful pass of
the first one.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d

Reviewed-by: Laura Ekstrand <laura at jlekstrand.net>

---

 src/mesa/main/teximage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 3b309ab..cd45113 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4586,7 +4586,8 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
        * are valid here, which they are not, but of course not mentioned by
        * core spec.
        */
-      if (target != GL_TEXTURE_2D_ARRAY && target != GL_TEXTURE_CUBE_MAP_ARRAY) {
+      if (targetOK && target != GL_TEXTURE_2D_ARRAY &&
+          target != GL_TEXTURE_CUBE_MAP_ARRAY) {
          bool invalidformat;
          switch (format) {
             /* These came from _mesa_is_compressed_format in glformats.c. */




More information about the mesa-commit mailing list