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.
This commit is contained in:
comex 2014-09-03 00:08:50 -04:00
parent dd5be7c0dc
commit b48e059173
1 changed files with 2 additions and 1 deletions

View File

@ -1734,6 +1734,7 @@ void Renderer::RestoreAPIState()
VertexManager *vm = (OGL::VertexManager*)g_vertex_manager; VertexManager *vm = (OGL::VertexManager*)g_vertex_manager;
glBindBuffer(GL_ARRAY_BUFFER, vm->m_vertex_buffers); glBindBuffer(GL_ARRAY_BUFFER, vm->m_vertex_buffers);
if (vm->m_last_vao)
glBindVertexArray(vm->m_last_vao); glBindVertexArray(vm->m_last_vao);
TextureCache::SetStage(); TextureCache::SetStage();