diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 3f95b7c1..c6f9b8bf 100755 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -3091,7 +3091,8 @@ namespace bgfx { // BX_TRACE("game wait"); int64_t start = bx::getHPCounter(); - m_gameSem.wait(); + bool ok = m_gameSem.wait(); + BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok); m_render->m_waitSubmit = bx::getHPCounter()-start; } @@ -3105,7 +3106,8 @@ namespace bgfx { // BX_TRACE("render wait"); int64_t start = bx::getHPCounter(); - m_renderSem.wait(); + bool ok = m_renderSem.wait(); + BX_CHECK(ok, "Semaphore wait failed."); BX_UNUSED(ok); m_submit->m_waitRender = bx::getHPCounter() - start; } diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 295ee548..9e4b03a3 100755 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -443,6 +443,7 @@ namespace bgfx void update(uint32_t _offset, uint32_t _size, void* _data) { + BX_CHECK(0 != m_id, "Updating invalid index buffer."); GL_CHECK(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_id) ); GL_CHECK(glBufferSubData(GL_ELEMENT_ARRAY_BUFFER , _offset @@ -484,6 +485,7 @@ namespace bgfx void update(uint32_t _offset, uint32_t _size, void* _data) { + BX_CHECK(0 != m_id, "Updating invalid vertex buffer."); GL_CHECK(glBindBuffer(GL_ARRAY_BUFFER, m_id) ); GL_CHECK(glBufferSubData(GL_ARRAY_BUFFER , _offset