From 7b59fb716a8cd28fbbc36747e37c5491c489aff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 18 Aug 2016 19:02:57 -0700 Subject: [PATCH] Fixed stale VAO issue. --- src/renderer_gl.cpp | 21 +++++++++++++-------- src/renderer_gl.h | 4 ++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 0fea6a7c9..8b2555260 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1074,6 +1074,7 @@ namespace bgfx { namespace gl case GL_DEBUG_SEVERITY_HIGH: return "High"; case GL_DEBUG_SEVERITY_MEDIUM: return "Medium"; case GL_DEBUG_SEVERITY_LOW: return "Low"; + case GL_DEBUG_SEVERITY_NOTIFICATION: return "SPAM"; default: break; } @@ -1083,14 +1084,17 @@ namespace bgfx { namespace gl void GL_APIENTRY debugProcCb(GLenum _source, GLenum _type, GLuint _id, GLenum _severity, GLsizei /*_length*/, const GLchar* _message, const void* /*_userParam*/) { - BX_TRACE("src %s, type %s, id %d, severity %s, '%s'" - , toString(_source) - , toString(_type) - , _id - , toString(_severity) - , _message - ); - BX_UNUSED(_source, _type, _id, _severity, _message); + if (GL_DEBUG_SEVERITY_NOTIFICATION != _severity) + { + BX_TRACE("src %s, type %s, id %d, severity %s, '%s'" + , toString(_source) + , toString(_type) + , _id + , toString(_severity) + , _message + ); + BX_UNUSED(_source, _type, _id, _severity, _message); + } } GLint glGet(GLenum _pname) @@ -5935,6 +5939,7 @@ namespace bgfx { namespace gl if (BGFX_CLEAR_NONE != (clear.m_flags & BGFX_CLEAR_MASK) ) { clearQuad(_clearQuad, viewState.m_rect, clear, resolutionHeight, _render->m_colorPalette); + currentVao = UINT32_MAX; // clearQuad will mess with VAO, invalidate it. } GL_CHECK(glDisable(GL_STENCIL_TEST) ); diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 189c17b29..ebf745fe4 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -883,6 +883,10 @@ typedef uint64_t GLuint64; # define GL_MAX_NAME_LENGTH 0x92F6 #endif // GL_MAX_NAME_LENGTH +#ifndef GL_DEBUG_SEVERITY_NOTIFICATION +# define GL_DEBUG_SEVERITY_NOTIFICATION 0x826b +#endif // GL_DEBUG_SEVERITY_NOTIFICATION + #if BX_PLATFORM_NACL # include "glcontext_ppapi.h" #elif BX_PLATFORM_WINDOWS