From d245724399b7ac9e2ddf99d381f7fe092204006a Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Tue, 10 Oct 2017 13:58:44 +0200 Subject: st/mesa: fix switching from surface-based to non-surface-based textures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This can happen with surface-based texture objects derived from EGL images, since those aren't immutable. Fixes tests in dEQP-EGL.functional.sharing.gles2.multithread.random.images.teximage2d.* and others Reviewed-by: Marek Olšák --- src/mesa/state_tracker/st_cb_texture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/state_tracker/st_cb_texture.c') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b5006b05a7b..b0a95ecbc79 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -693,7 +693,8 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage, const GLuint level = texImage->Level; mesa_format texFormat; - _mesa_clear_texture_object(ctx, texObj); + assert(!st_texture_image(texImage)->pt); + _mesa_clear_texture_object(ctx, texObj, texImage); pipe_resource_reference(&stObj->pt, NULL); /* oops, need to init this image again */ -- cgit v1.2.3