mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 19:55:58 +08:00
#7415 - GCodeViewer::refresh_render_paths() - Remove empty render paths to avoid calling glMultiDrawElements() with empty data while rendering toolpaths.
This commit is contained in:
parent
d4d558ebee
commit
c7a4f61238
@ -2433,6 +2433,18 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// removes empty render paths
|
||||||
|
for (size_t b = 0; b < m_buffers.size(); ++b) {
|
||||||
|
TBuffer* buffer = const_cast<TBuffer*>(&m_buffers[b]);
|
||||||
|
std::set<RenderPath, RenderPathPropertyLower>::iterator it = buffer->render_paths.begin();
|
||||||
|
while (it != buffer->render_paths.end()) {
|
||||||
|
if (it->sizes.empty() || it->offsets.empty())
|
||||||
|
it = buffer->render_paths.erase(it);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// second pass: for buffers using instanced and batched models, update the instances render ranges
|
// second pass: for buffers using instanced and batched models, update the instances render ranges
|
||||||
for (size_t b = 0; b < m_buffers.size(); ++b) {
|
for (size_t b = 0; b < m_buffers.size(); ++b) {
|
||||||
TBuffer& buffer = const_cast<TBuffer&>(m_buffers[b]);
|
TBuffer& buffer = const_cast<TBuffer&>(m_buffers[b]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user