summaryrefslogtreecommitdiff
path: root/src/video_core
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-10-29 21:17:16 -0300
committerGravatar ReinUsesLisp2019-10-29 21:27:25 -0300
commit3c6557c235a9b5a1f76ac5a07d301fdf3a615e2a (patch)
tree65c508f3183afcb14074408717e9f3eac40d8c92 /src/video_core
parentgl_state: Change SetDefaultViewports to use default constructor (diff)
downloadyuzu-3c6557c235a9b5a1f76ac5a07d301fdf3a615e2a.tar.gz
yuzu-3c6557c235a9b5a1f76ac5a07d301fdf3a615e2a.tar.xz
yuzu-3c6557c235a9b5a1f76ac5a07d301fdf3a615e2a.zip
gl_state: Remove ApplyDefaultState
OpenGL has defaults values we can trust. Remove these.
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_state.h5
3 files changed, 1 insertions, 17 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 43032e9a7..8774e836c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -68,8 +68,6 @@ RasterizerOpenGL::RasterizerOpenGL(Core::System& system, Core::Frontend::EmuWind
68 ScreenInfo& info) 68 ScreenInfo& info)
69 : texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device}, 69 : texture_cache{system, *this, device}, shader_cache{*this, system, emu_window, device},
70 system{system}, screen_info{info}, buffer_cache{*this, system, STREAM_BUFFER_SIZE} { 70 system{system}, screen_info{info}, buffer_cache{*this, system, STREAM_BUFFER_SIZE} {
71 OpenGLState::ApplyDefaultState();
72
73 shader_program_manager = std::make_unique<GLShader::ProgramManager>(); 71 shader_program_manager = std::make_unique<GLShader::ProgramManager>();
74 state.draw.shader_program = 0; 72 state.draw.shader_program = 0;
75 state.Apply(); 73 state.Apply();
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index cfd1481de..48c123ffe 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -92,17 +92,6 @@ void OpenGLState::SetDefaultViewports() {
92 depth_clamp.near_plane = false; 92 depth_clamp.near_plane = false;
93} 93}
94 94
95void OpenGLState::ApplyDefaultState() {
96 glEnable(GL_BLEND);
97 glDisable(GL_FRAMEBUFFER_SRGB);
98 glDisable(GL_CULL_FACE);
99 glDisable(GL_DEPTH_TEST);
100 glDisable(GL_PRIMITIVE_RESTART);
101 glDisable(GL_STENCIL_TEST);
102 glDisable(GL_COLOR_LOGIC_OP);
103 glDisable(GL_SCISSOR_TEST);
104}
105
106void OpenGLState::ApplyFramebufferState() const { 95void OpenGLState::ApplyFramebufferState() const {
107 if (UpdateValue(cur_state.draw.read_framebuffer, draw.read_framebuffer)) { 96 if (UpdateValue(cur_state.draw.read_framebuffer, draw.read_framebuffer)) {
108 glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer); 97 glBindFramebuffer(GL_READ_FRAMEBUFFER, draw.read_framebuffer);
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 805ee9e4a..b95f33613 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -70,7 +70,7 @@ public:
70 } stencil; 70 } stencil;
71 71
72 struct Blend { 72 struct Blend {
73 bool enabled = true; // GL_BLEND 73 bool enabled = false; // GL_BLEND
74 GLenum rgb_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_RGB 74 GLenum rgb_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_RGB
75 GLenum a_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_ALPHA 75 GLenum a_equation = GL_FUNC_ADD; // GL_BLEND_EQUATION_ALPHA
76 GLenum src_rgb_func = GL_ONE; // GL_BLEND_SRC_RGB 76 GLenum src_rgb_func = GL_ONE; // GL_BLEND_SRC_RGB
@@ -183,9 +183,6 @@ public:
183 void ApplyPolygonOffset() const; 183 void ApplyPolygonOffset() const;
184 void ApplyAlphaTest() const; 184 void ApplyAlphaTest() const;
185 185
186 /// Set the initial OpenGL state
187 static void ApplyDefaultState();
188
189 /// Resets any references to the given resource 186 /// Resets any references to the given resource
190 OpenGLState& UnbindTexture(GLuint handle); 187 OpenGLState& UnbindTexture(GLuint handle);
191 OpenGLState& ResetSampler(GLuint handle); 188 OpenGLState& ResetSampler(GLuint handle);