Skip to content

Commit

Permalink
GLPushBuffer::Flush: Add debug-assert-and-bail prompted by suspicious…
Browse files Browse the repository at this point in the history
… callstack
  • Loading branch information
hrydgard committed May 3, 2023
1 parent 5724bbd commit 1d053d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Common/GPU/OpenGL/GLRenderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ void GLPushBuffer::Flush() {
// Must be called from the render thread.
_dbg_assert_(OnRenderThread());

if (buf_ >= buffers_.size()) {
_dbg_assert_msg_(false, "buf_ somehow got out of sync: %d vs %d", (int)buf_, (int)buffers_.size());
return;
}

buffers_[buf_].flushOffset = offset_;
if (!buffers_[buf_].deviceMemory && writePtr_) {
auto &info = buffers_[buf_];
Expand Down

0 comments on commit 1d053d2

Please sign in to comment.