[Mesa-dev] [PATCH 2/3] mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls

Eduardo Lima Mitev elima at igalia.com
Mon Mar 23 04:30:00 PDT 2015


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
---
 src/mesa/main/teximage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 9f7e10c..1af2896 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4598,7 +4598,7 @@ compressed_subtexture_target_check(struct gl_context *ctx, GLenum target,
        *    non-zero, or the effective target for the texture is not
        *    TEXTURE_2D_ARRAY."
        */
-      if (target != GL_TEXTURE_2D_ARRAY) {
+      if (targetOK && target != GL_TEXTURE_2D_ARRAY) {
          bool invalidformat;
          switch (format) {
             /* These came from _mesa_is_compressed_format in glformats.c. */
-- 
2.1.3



More information about the mesa-dev mailing list