From 7f0bdc21a8f1a5fbe2afdba61f037a71f00c1d61 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Thu, 3 May 2018 12:17:04 +0200 Subject: Remove race in texture data upload In the non locked submission phase of the renderer, the GLTextures must have had their content/properties already updated as this is too late to actually create or upload texture based on references which may be invalid or outdated. This wasn't properly handled. We now perfom the GLTexture creation and data upload when both the RenderThread and AspectThread are locked. Task-number: QTBUG-67989 Change-Id: I07ac23120e8d37a86e60d2b892d1437b8cb0b3dc Reviewed-by: Sean Harmer --- src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/render/renderers/opengl/graphicshelpers') diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp index 7072ed03e..3ebc965df 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -885,7 +885,8 @@ int SubmissionContext::activateTexture(TextureScope scope, GLTexture *tex, int o // actually re-bind if required, the tex->dna on the unit not being the same // Note: tex->dna() could be 0 if the texture has not been created yet if (m_activeTextures[onUnit].texture != tex) { - QOpenGLTexture *glTex = tex->getOrCreateGLTexture(); + // Texture must have been created and updated at this point + QOpenGLTexture *glTex = tex->getGLTexture(); if (glTex == nullptr) return -1; glTex->bind(onUnit); -- cgit v1.2.3