From b48e059173ccb02cd3b13e5c8de21b2eac36abf1 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 3 Sep 2014 00:08:50 -0400 Subject: [PATCH] Don't switch to a vertex array object of 0. This causes glDrawArrays to fail in core profile, and thus on OS X, see: http://renderingpipeline.com/2012/03/attribute-less-rendering/ There must be something bound, even though it is not used. Fixes #7599. I'm not sure this is actually the best way to fix it, since AFAICT it makes a nonobvious assumption that *something* will be bound before the first attributeless rendering in TextureConverter::DecodeToTexture, but it's what degasus suggested and seems to work. --- Source/Core/VideoBackends/OGL/Render.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 85836f0c11..f234d7f242 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1734,7 +1734,8 @@ void Renderer::RestoreAPIState() VertexManager *vm = (OGL::VertexManager*)g_vertex_manager; glBindBuffer(GL_ARRAY_BUFFER, vm->m_vertex_buffers); - glBindVertexArray(vm->m_last_vao); + if (vm->m_last_vao) + glBindVertexArray(vm->m_last_vao); TextureCache::SetStage(); }