aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_state.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-06-26 22:05:49 -0400
committerGitHub <noreply@github.com>2018-06-26 22:05:49 -0400
commitdfac394e60d9ae07348b18c88fff7892e4172318 (patch)
tree29d6255ff5d8418c0b7288d37e76ac2f6f2c7328 /src/video_core/renderer_opengl/gl_state.cpp
parent73de9bab1a55b4953de1b8ce37ed22cac5f10ef5 (diff)
parent8447d20a117676360b0e7b08fc736e1d639e62fc (diff)
Merge pull request #593 from bunnei/fix-swizzle
gl_state: Fix state management for texture swizzle.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_state.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index dd5e8de26..2e8a422a8 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();
}
draw.read_framebuffer = 0;
@@ -286,10 +281,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();
}
}
return *this;