diff options
author | bunnei <bunneidev@gmail.com> | 2020-03-11 18:51:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 18:51:54 +0100 |
commit | fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7 (patch) | |
tree | 3eb7c0c781ff3ad5485134bcfe042c8533c67a02 /src/video_core/renderer_opengl/gl_shader_manager.h | |
parent | Merge pull request #3458 from FearlessTobi/voice-issues (diff) | |
parent | gl_shader_manager: Fix interaction between graphics and compute (diff) | |
download | yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar.gz yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar.bz2 yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar.lz yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar.xz yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.tar.zst yuzu-fce33adcf1cb16bc308c39cd47b0a4e1aee68bf7.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_manager.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index e94cd75aa..d2e47f2a9 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h @@ -28,11 +28,16 @@ static_assert(sizeof(MaxwellUniformData) < 16384, class ProgramManager { public: + explicit ProgramManager(); ~ProgramManager(); void Create(); - void Update(); + /// Updates the graphics pipeline and binds it. + void BindGraphicsPipeline(); + + /// Binds a compute shader. + void BindComputeShader(GLuint program); void UseVertexShader(GLuint program) { current_state.vertex_shader = program; @@ -46,33 +51,27 @@ public: current_state.fragment_shader = program; } - GLuint GetHandle() const { - return pipeline.handle; - } - - void UseTrivialFragmentShader() { - current_state.fragment_shader = 0; - } - private: struct PipelineState { - bool operator==(const PipelineState& rhs) const { + bool operator==(const PipelineState& rhs) const noexcept { return vertex_shader == rhs.vertex_shader && fragment_shader == rhs.fragment_shader && geometry_shader == rhs.geometry_shader; } - bool operator!=(const PipelineState& rhs) const { + bool operator!=(const PipelineState& rhs) const noexcept { return !operator==(rhs); } - GLuint vertex_shader{}; - GLuint fragment_shader{}; - GLuint geometry_shader{}; + GLuint vertex_shader = 0; + GLuint fragment_shader = 0; + GLuint geometry_shader = 0; }; - OGLPipeline pipeline; + OGLPipeline graphics_pipeline; + OGLPipeline compute_pipeline; PipelineState current_state; PipelineState old_state; + bool is_graphics_bound = true; }; } // namespace OpenGL::GLShader |