general improvements to the renderer backend to help keep rendering consistent and performant
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user