From 0c447e0a067c0445f45f333ba35597dbc6a5b656 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 5 Mar 2016 18:09:55 -0800 Subject: [PATCH] OpenGL: Don't attempt to draw empty triangle batches Our code did not handle this well, causing random crashes in some situations. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index b3dc6aa19e..1fadcf5aeb 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -190,6 +190,9 @@ void RasterizerOpenGL::AddTriangle(const Pica::Shader::OutputVertex& v0, } void RasterizerOpenGL::DrawTriangles() { + if (vertex_batch.empty()) + return; + SyncFramebuffer(); SyncDrawState();