diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-03-09 22:34:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 22:34:37 +0100 |
commit | 22e825a3bc0d9bfb5f8c29a50724c2887014dc02 (patch) | |
tree | d68f0ace93ba44292e3017dcb219f3132b3314ef /src/video_core/renderer_opengl/gl_shader_manager.cpp | |
parent | Merge pull request #3486 from ReinUsesLisp/fix-anisotropy-hack (diff) | |
parent | video_core/dirty_flags: Address feedback (diff) | |
download | yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.gz yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.bz2 yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.lz yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.xz yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.tar.zst yuzu-22e825a3bc0d9bfb5f8c29a50724c2887014dc02.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_manager.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index 75d3fac04..15f3cd066 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -10,27 +10,21 @@ namespace OpenGL::GLShader { using Tegra::Engines::Maxwell3D; -ProgramManager::ProgramManager() { - pipeline.Create(); -} - ProgramManager::~ProgramManager() = default; -void ProgramManager::ApplyTo(OpenGLState& state) { - UpdatePipeline(); - state.draw.shader_program = 0; - state.draw.program_pipeline = pipeline.handle; +void ProgramManager::Create() { + pipeline.Create(); } -void ProgramManager::UpdatePipeline() { +void ProgramManager::Update() { // Avoid updating the pipeline when values have no changed if (old_state == current_state) { return; } // Workaround for AMD bug - constexpr GLenum all_used_stages{GL_VERTEX_SHADER_BIT | GL_GEOMETRY_SHADER_BIT | - GL_FRAGMENT_SHADER_BIT}; + static constexpr GLenum all_used_stages{GL_VERTEX_SHADER_BIT | GL_GEOMETRY_SHADER_BIT | + GL_FRAGMENT_SHADER_BIT}; glUseProgramStages(pipeline.handle, all_used_stages, 0); glUseProgramStages(pipeline.handle, GL_VERTEX_SHADER_BIT, current_state.vertex_shader); |