From 8447d20a117676360b0e7b08fc736e1d639e62fc Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 26 Jun 2018 16:58:35 -0400 Subject: gl_state: Fix state management for texture swizzle. --- src/video_core/renderer_opengl/gl_state.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_state.cpp') diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 6e5f9a789..d1b3ad958 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -48,12 +48,7 @@ OpenGLState::OpenGLState() { logic_op = GL_COPY; for (auto& texture_unit : texture_units) { - texture_unit.texture_2d = 0; - texture_unit.sampler = 0; - texture_unit.swizzle.r = GL_RED; - texture_unit.swizzle.g = GL_GREEN; - texture_unit.swizzle.b = GL_BLUE; - texture_unit.swizzle.a = GL_ALPHA; + texture_unit.Reset(); } lighting_lut.texture_buffer = 0; @@ -338,10 +333,10 @@ void OpenGLState::Apply() const { cur_state = *this; } -OpenGLState& OpenGLState::ResetTexture(GLuint handle) { +OpenGLState& OpenGLState::UnbindTexture(GLuint handle) { for (auto& unit : texture_units) { if (unit.texture_2d == handle) { - unit.texture_2d = 0; + unit.Unbind(); } } if (lighting_lut.texture_buffer == handle) -- cgit v1.2.3