diff --git a/src/xenia/gpu/gl4/gl4_command_processor.cc b/src/xenia/gpu/gl4/gl4_command_processor.cc index 9855b137f..10666b53f 100644 --- a/src/xenia/gpu/gl4/gl4_command_processor.cc +++ b/src/xenia/gpu/gl4/gl4_command_processor.cc @@ -465,6 +465,12 @@ void GL4CommandProcessor::PerformSwap(uint32_t frontbuffer_ptr, // TODO(benvanik): prevent this? fences? glFinish(); + if (context_->WasLost()) { + // We've lost the context due to a TDR. + // TODO: Dump the current commands to a tracefile. + assert_always(); + } + // Remove any dead textures, etc. texture_cache_.Scavenge(); } @@ -581,8 +587,15 @@ bool GL4CommandProcessor::IssueDraw(PrimitiveType prim_type, if (!draw_batcher_.CommitDraw()) { return false; } + // TODO(benvanik): find a way to get around glVertexArrayVertexBuffer below. draw_batcher_.Flush(DrawBatcher::FlushMode::kMakeCoherent); + if (context_->WasLost()) { + // This draw lost us the context. This typically isn't hit. + assert_always(); + return false; + } + return true; }