From 0b0230e27d27a878f332bdabed73fff5cff314af 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 inside drivers. Fixes #1251. --- 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 0f864b617..490a605ec 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();