diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 574ba6ec5..8f1990a57 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2654,6 +2654,9 @@ void GCodeViewer::render_toolpaths() for (auto it = it_path; it != it_end && it_path->ibuffer_id == it->ibuffer_id; ++it) { const RenderPath& path = *it; + // Some OpenGL drivers crash on empty glMultiDrawElements, see GH #7415. + assert(! path.sizes.empty()); + assert(! path.offsets.empty()); glsafe(::glUniform4fv(uniform_color, 1, static_cast(path.color.data()))); glsafe(::glMultiDrawElements(GL_POINTS, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_SHORT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); #if ENABLE_GCODE_VIEWER_STATISTICS @@ -2675,6 +2678,9 @@ void GCodeViewer::render_toolpaths() ](std::vector::iterator it_path, std::vector::iterator it_end, GLShaderProgram& shader, int uniform_color) { for (auto it = it_path; it != it_end && it_path->ibuffer_id == it->ibuffer_id; ++it) { const RenderPath& path = *it; + // Some OpenGL drivers crash on empty glMultiDrawElements, see GH #7415. + assert(! path.sizes.empty()); + assert(! path.offsets.empty()); glsafe(::glUniform4fv(uniform_color, 1, static_cast(path.color.data()))); glsafe(::glMultiDrawElements(GL_LINES, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_SHORT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); #if ENABLE_GCODE_VIEWER_STATISTICS @@ -2690,6 +2696,9 @@ void GCodeViewer::render_toolpaths() ](std::vector::iterator it_path, std::vector::iterator it_end, GLShaderProgram& shader, int uniform_color) { for (auto it = it_path; it != it_end && it_path->ibuffer_id == it->ibuffer_id; ++it) { const RenderPath& path = *it; + // Some OpenGL drivers crash on empty glMultiDrawElements, see GH #7415. + assert(! path.sizes.empty()); + assert(! path.offsets.empty()); glsafe(::glUniform4fv(uniform_color, 1, static_cast(path.color.data()))); glsafe(::glMultiDrawElements(GL_TRIANGLES, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_SHORT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size())); #if ENABLE_GCODE_VIEWER_STATISTICS