[Mesa-dev] [PATCH 5/5] mesa: flush and wait after creating a fallback texture

Nicolai Hähnle nhaehnle at gmail.com
Sun Oct 22 19:18:12 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Fixes non-deterministic failures in
dEQP-EGL.functional.sharing.gles2.multithread.simple_egl_sync.images.texture_source.teximage2d_render
and others in dEQP-EGL.functional.sharing.gles2.multithread.*
---
 src/mesa/main/texobj.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 1978898b8b9..9d625fa0aea 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1044,20 +1044,25 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex)
          ctx->Driver.TexImage(ctx, dims, texImage,
                               GL_RGBA, GL_UNSIGNED_BYTE, texel,
                               &ctx->DefaultPacking);
       }
 
       _mesa_test_texobj_completeness(ctx, texObj);
       assert(texObj->_BaseComplete);
       assert(texObj->_MipmapComplete);
 
       ctx->Shared->FallbackTex[tex] = texObj;
+
+      /* Complete the driver's operation in case another context will also
+       * use the same fallback texture. */
+      if (ctx->Driver.Finish)
+         ctx->Driver.Finish(ctx);
    }
    return ctx->Shared->FallbackTex[tex];
 }
 
 
 /**
  * Compute the size of the given texture object, in bytes.
  */
 static GLuint
 texture_size(const struct gl_texture_object *texObj)
-- 
2.11.0



More information about the mesa-dev mailing list