summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>2019-08-21 13:16:16 +0100
committerDylan Baker <dylan@pnwbakers.com>2019-09-04 11:51:25 -0700
commit0504bff354f301bb70a050e653ba90fed97b4309 (patch)
tree26f51b63caf6f80925ad6488b4455c186487f5b2
parent637a9cbd3b6e48ccd0e08d781846e139d2bf5829 (diff)
downloadmesa-0504bff354f301bb70a050e653ba90fed97b4309.tar.gz
mesa: recover target_check before get_current_tex_objects
At compressed_tex_sub_image we only can obtain the tex_object after compressed_subtexture_target_check is validated for TEX_MODE_CURRENT. So if the target is wrong the error is raised to the user. This completes the fix for the regression introduced on "mesa: refactor compressed_tex_sub_image function" of the pending failing tests: dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage3d v2: Fix warning that texObj might be used uninitialized (Gert Wollny) Fixes: 7df233d68dc ("mesa: refactor compressed_tex_sub_image function") Reviewed-By: Gert Wollny <gert.wollny@collabora.com> (cherry picked from commit 74a7e3ed3b297f441b406ff62ef9ba504ba3b06c)
-rw-r--r--src/mesa/main/teximage.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index e940ecd7323..f90765f40fa 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5588,7 +5588,7 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint textureOrIndex,
const GLvoid *data, enum tex_mode mode,
const char *caller)
{
- struct gl_texture_object *texObj;
+ struct gl_texture_object *texObj = NULL;
struct gl_texture_image *texImage;
bool no_error = false;
GET_CURRENT_CONTEXT(ctx);
@@ -5622,14 +5622,9 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint textureOrIndex,
case TEX_MODE_CURRENT_ERROR:
default:
assert(textureOrIndex == 0);
- texObj = _mesa_get_current_tex_object(ctx, target);
break;
}
- if (!texObj)
- return;
-
-
if (!no_error &&
compressed_subtexture_target_check(ctx, target, dim, format,
mode == TEX_MODE_DSA_ERROR,
@@ -5637,7 +5632,12 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint textureOrIndex,
return;
}
- if (!no_error && !texObj)
+ if (mode == TEX_MODE_CURRENT_NO_ERROR ||
+ mode == TEX_MODE_CURRENT_ERROR) {
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ }
+
+ if (!texObj)
return;
if (!no_error &&