summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_manager.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-03-11 05:03:01 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-03-11 05:04:52 +0100
commit835790809954bb5962f8893320b8f5c3ad82d6a0 (patch)
tree30e258936c1282f31143f465f1c310563dd9acfa /src/video_core/renderer_opengl/gl_shader_manager.h
parentMerge pull request #3301 from ReinUsesLisp/state-tracker (diff)
downloadyuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar.gz
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar.bz2
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar.lz
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar.xz
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.tar.zst
yuzu-835790809954bb5962f8893320b8f5c3ad82d6a0.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_manager.h')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.h29
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