summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-22 06:22:09 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-07-22 06:22:09 +0200
commite5c4fe0098e1445ac5780f130bb9cc3c53177051 (patch)
tree6062954ba31f7d0e7ad51382674d5369f44e1a5f /src/video_core
parentMerge pull request #966 from Subv/log (diff)
downloadyuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar.gz
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar.bz2
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar.lz
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar.xz
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.tar.zst
yuzu-e5c4fe0098e1445ac5780f130bb9cc3c53177051.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 3526e16d5..9efc15337 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -147,20 +147,17 @@ void OpenGLState::Apply() {
// Textures
for (unsigned texture_index = 0; texture_index < ARRAY_SIZE(texture_units); ++texture_index) {
- if (texture_units[texture_index].enabled_2d != cur_state.texture_units[texture_index].enabled_2d) {
+ if (texture_units[texture_index].enabled_2d != cur_state.texture_units[texture_index].enabled_2d ||
+ texture_units[texture_index].texture_2d != cur_state.texture_units[texture_index].texture_2d) {
+
glActiveTexture(GL_TEXTURE0 + texture_index);
if (texture_units[texture_index].enabled_2d) {
- glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, texture_units[texture_index].texture_2d);
} else {
- glDisable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, 0);
}
}
-
- if (texture_units[texture_index].texture_2d != cur_state.texture_units[texture_index].texture_2d) {
- glActiveTexture(GL_TEXTURE0 + texture_index);
- glBindTexture(GL_TEXTURE_2D, texture_units[texture_index].texture_2d);
- }
}
// Framebuffer