diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2018-05-03 12:17:04 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-05-04 04:10:43 +0000 |
commit | 7f0bdc21a8f1a5fbe2afdba61f037a71f00c1d61 (patch) | |
tree | 8c3d04f8f33858cc5b32c20d1cd558372b8b1f66 /src/render/renderers/opengl/graphicshelpers | |
parent | dcc7f1548425c2a8cabad3282b98939f05cc2513 (diff) |
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 <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl/graphicshelpers')
-rw-r--r-- | src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); |