ensure texture is not copied in one thread while it's read in another

This seems to cause issues in the rendering pipeline, so this commit never lets
a texture copy and read occur at the same time.
This commit is contained in:
itsmattkc
2020-01-02 06:00:21 +11:00
parent 7eae6a85f8
commit f8839e74de
4 changed files with 25 additions and 0 deletions
@@ -156,6 +156,16 @@ void OpenGLTexture::Upload(const void *data)
Release();
}
void OpenGLTexture::Lock()
{
mutex_.lock();
}
void OpenGLTexture::Unlock()
{
mutex_.unlock();
}
void OpenGLTexture::CreateInternal(QOpenGLContext* create_ctx, GLuint* tex, const void *data)
{
QOpenGLFunctions* f = create_ctx->functions();