implemented texture cache for performance

Creating and destroying textures is a slow process, particularly when we can
re-use them throughout most of the render chain. We now keep them stored so
they can be re-used which improves performance substantially.
This commit is contained in:
itsmattkc
2019-12-10 14:53:47 +11:00
parent 6ac33d8dc4
commit 91c7d8aa4d
9 changed files with 55 additions and 35 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ bool OpenGLTexture::IsCreated() const
return (texture_ != 0);
}
void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, void* data)
void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, const void* data)
{
if (ctx == nullptr) {
qWarning() << "RenderTexture::Create was passed an invalid context";
@@ -182,7 +182,7 @@ uchar *OpenGLTexture::Download() const
return data;
}
void OpenGLTexture::CreateInternal(GLuint* tex, void *data)
void OpenGLTexture::CreateInternal(GLuint* tex, const void *data)
{
QOpenGLFunctions* f = context_->functions();