general improvements to the renderer backend to help keep rendering consistent and performant

This commit is contained in:
itsmattkc
2019-12-22 03:04:34 +11:00
parent 46855adea7
commit a8beae64ae
4 changed files with 29 additions and 25 deletions
@@ -29,9 +29,7 @@ OpenGLTextureCache::ReferencePtr OpenGLTextureCache::Get(QOpenGLContext* ctx, co
// If we didn't find a texture, we'll need to create one
if (!texture) {
texture = std::make_shared<OpenGLTexture>();
texture->Create(ctx, params.effective_width(), params.effective_height(), params.format(), data);
} else if (data) {
texture->Upload(data);
texture->Create(ctx, params.effective_width(), params.effective_height(), params.format());
}
ReferencePtr ref = std::make_shared<Reference>(this, texture);
@@ -39,6 +37,10 @@ OpenGLTextureCache::ReferencePtr OpenGLTextureCache::Get(QOpenGLContext* ctx, co
lock_.unlock();
if (data) {
texture->Upload(data);
}
return ref;
}