Added GL_CHECK_I macro to ignore GL errors.

This commit is contained in:
Branimir Karadžić 2014-03-27 09:19:44 -07:00
parent eecbf19c57
commit b42819a87a
2 changed files with 13 additions and 8 deletions

View file

@ -1406,7 +1406,7 @@ namespace bgfx
if (NULL == glInsertEventMarker)
{
glInsertEventMarker = NULL != glStringMarkerGREMEDY
glInsertEventMarker = NULL != glStringMarkerGREMEDY
? stubInsertEventMarkerGREMEDY
: stubInsertEventMarker
;
@ -3287,7 +3287,7 @@ namespace bgfx
void Context::rendererSetMarker(const char* _marker, uint32_t _size)
{
GL_CHECK(glInsertEventMarker(_size, _marker) );
GL_CHECK_I(glInsertEventMarker(_size, _marker) );
}
void Context::rendererSubmit()
@ -3384,7 +3384,7 @@ namespace bgfx
currentState.m_flags = newFlags;
currentState.m_stencil = newStencil;
GL_CHECK(glInsertEventMarker(0, s_viewName[key.m_view]) );
GL_CHECK_I(glInsertEventMarker(0, s_viewName[key.m_view]) );
view = key.m_view;
programIdx = invalidHandle;
@ -4224,7 +4224,7 @@ namespace bgfx
m_textVideoMemBlitter.blit(m_render->m_textVideoMem);
}
GL_CHECK(glFrameTerminatorGREMEDY() );
GL_CHECK_I(glFrameTerminatorGREMEDY() );
}
}

View file

@ -338,18 +338,23 @@ typedef uint64_t GLuint64;
namespace bgfx
{
# define _GL_CHECK(_call) \
#define _GL_CHECK(_check, _call) \
do { \
/*BX_TRACE(#_call);*/ \
_call; \
GLenum err = glGetError(); \
BX_CHECK(0 == err, #_call "; glError 0x%x %d", err, err); \
_check(0 == err, #_call "; glError 0x%x %d", err, err); \
BX_UNUSED(err); \
} while (0)
#define IGNORE(...) do {} while(0)
#if BGFX_CONFIG_DEBUG
# define GL_CHECK(_call) _GL_CHECK(_call)
# define GL_CHECK(_call) _GL_CHECK(BX_CHECK, _call)
# define GL_CHECK_I(_call) _GL_CHECK(IGNORE, _call)
#else
# define GL_CHECK(_call) _call
# define GL_CHECK(_call) _call
# define GL_CHECK_I(_call) _call
#endif // BGFX_CONFIG_DEBUG
#define GL_IMPORT_TYPEDEFS 1