From f9c829c7f711efadea1db7aabb51c703380fa03a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 25 Feb 2018 17:56:09 +1000 Subject: OGL: Re-implement async shader compiling --- Source/Core/VideoBackends/OGL/ProgramShaderCache.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/ProgramShaderCache.h') diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h index af2aa10383..0096c6e5b9 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.h +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.h @@ -11,6 +11,7 @@ #include #include "Common/GL/GLUtil.h" +#include "VideoCommon/AsyncShaderCompiler.h" namespace OGL { @@ -87,7 +88,8 @@ public: static void Shutdown(); static void CreateHeader(); - static const PipelineProgram* GetPipelineProgram(const OGLShader* vertex_shader, + static const PipelineProgram* GetPipelineProgram(const GLVertexFormat* vertex_format, + const OGLShader* vertex_shader, const OGLShader* geometry_shader, const OGLShader* pixel_shader); static void ReleasePipelineProgram(const PipelineProgram* prog); @@ -99,8 +101,8 @@ private: static void CreateAttributelessVAO(); - static PipelineProgramMap pipelineprograms; - static std::mutex pipelineprogramlock; + static PipelineProgramMap s_pipeline_programs; + static std::mutex s_pipeline_program_lock; static u32 s_ubo_buffer_size; static s32 s_ubo_align; @@ -110,4 +112,12 @@ private: static GLuint s_last_VAO; }; +class SharedContextAsyncShaderCompiler : public VideoCommon::AsyncShaderCompiler +{ +protected: + bool WorkerThreadInitMainThread(void** param) override; + bool WorkerThreadInitWorkerThread(void* param) override; + void WorkerThreadExit(void* param) override; +}; + } // namespace OGL -- cgit v1.2.3