From e3d7334be9c63e4aba7e90fec6c3bdedc743a785 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 22 Nov 2019 21:17:29 -0300 Subject: gl_state: Skip null texture binds glBindTextureUnit doesn't support null textures. Skip binding these. --- src/video_core/renderer_opengl/gl_state.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 4cf3d0a8a..39b3986d3 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -420,7 +420,11 @@ void OpenGLState::ApplyTextures() { const std::size_t size = std::size(textures); for (std::size_t i = 0; i < size; ++i) { if (UpdateValue(cur_state.textures[i], textures[i])) { - glBindTextureUnit(static_cast(i), textures[i]); + // BindTextureUnit doesn't support binding null textures, skip those binds. + // TODO(Rodrigo): Stop using null textures + if (textures[i] != 0) { + glBindTextureUnit(static_cast(i), textures[i]); + } } } } -- cgit v1.2.3