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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user