renderer: re-use the same opengl instance for all background rendering

Previously the OpenGL instance was tied to each render/cache task,
creating and destroying it each time one started and stopped. This was
completely unnecessary since the instance holds no state and can be
shared by all of the render tasks without having to expensively start
a new one.
This commit is contained in:
itsmattkc
2020-06-19 17:06:14 +10:00
parent ab74c1579e
commit b2a3cede2c
7 changed files with 52 additions and 41 deletions
+11
View File
@@ -41,6 +41,15 @@ public:
virtual ~OpenGLProxy() override;
static void CreateInstance();
static void DestroyInstance();
static OpenGLProxy* instance()
{
return instance_;
}
/**
* @brief Initialize OpenGL instance in whatever thread this object is a part of
*
@@ -101,6 +110,8 @@ private:
OpenGLTextureCache texture_cache_;
static OpenGLProxy* instance_;
private slots:
void FinishInit();