diff options
author | bubnikv <bubnikv@gmail.com> | 2018-02-22 16:44:07 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-02-22 16:44:07 +0300 |
commit | c60d825b47c10e8cafa0702520ac73fdb83e13bc (patch) | |
tree | f18f152cd542560f48468210c363013a4683a782 | |
parent | 67668b13c95167b6d16fc4cdc345ea2c30baff86 (diff) |
A workaround of the dreaded Intel HD Graphics driver issue at leastversion_1.39.2-alphaversion_1.39.1-beta1version_1.39.1
on the laptop of @roesel.
fixes https://github.com/prusa3d/Slic3r/issues/672
The Intel HD Graphics hangs on the glFinish() call for some reason
with one particular graphics driver revision. Also the glFinish() call
was superfluous and it only may have had negative effect over the performance.
Both glFinish() and glFlush() were removed for performance reasons
where they were not needed, see
https://www.khronos.org/opengl/wiki/Common_Mistakes
-rw-r--r-- | lib/Slic3r/GUI/3DScene.pm | 29 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Plater/2DToolpaths.pm | 2 |
2 files changed, 11 insertions, 20 deletions
diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm index 730216a8b..9b733f55c 100644 --- a/lib/Slic3r/GUI/3DScene.pm +++ b/lib/Slic3r/GUI/3DScene.pm @@ -1157,18 +1157,17 @@ sub Render { glLightfv_p(GL_LIGHT1, GL_POSITION, 1, 0, 1, 0); if ($self->enable_picking) { - # Render the object for picking. - # FIXME This cannot possibly work in a multi-sampled context as the color gets mangled by the anti-aliasing. - # Better to use software ray-casting on a bounding-box hierarchy. - glPushAttrib(GL_ENABLE_BIT); - glDisable(GL_MULTISAMPLE) if ($self->{can_multisample}); - glDisable(GL_LIGHTING); - glDisable(GL_BLEND); - $self->draw_volumes(1); - glFlush(); - glFinish(); - if (my $pos = $self->_mouse_pos) { + # Render the object for picking. + # FIXME This cannot possibly work in a multi-sampled context as the color gets mangled by the anti-aliasing. + # Better to use software ray-casting on a bounding-box hierarchy. + glPushAttrib(GL_ENABLE_BIT); + glDisable(GL_MULTISAMPLE) if ($self->{can_multisample}); + glDisable(GL_LIGHTING); + glDisable(GL_BLEND); + $self->draw_volumes(1); + glPopAttrib(); + glFlush(); my $col = [ glReadPixels_p($pos->x, $self->GetSize->GetHeight - $pos->y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE) ]; my $volume_idx = $col->[0] + $col->[1]*256 + $col->[2]*256*256; $self->_hover_volume_idx(undef); @@ -1184,11 +1183,8 @@ sub Render { $self->on_hover->($volume_idx) if $self->on_hover; } + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glFlush(); - glFinish(); - glPopAttrib(); } # draw fixed background @@ -1319,9 +1315,6 @@ sub Render { $self->draw_active_object_annotations; $self->SwapBuffers(); - - # Calling glFinish has a performance penalty, but it seems to fix some OpenGL driver hang-up with extremely large scenes. -# glFinish(); } sub draw_volumes { diff --git a/lib/Slic3r/GUI/Plater/2DToolpaths.pm b/lib/Slic3r/GUI/Plater/2DToolpaths.pm index e48793bb0..96a252a08 100644 --- a/lib/Slic3r/GUI/Plater/2DToolpaths.pm +++ b/lib/Slic3r/GUI/Plater/2DToolpaths.pm @@ -338,7 +338,6 @@ sub Render { glClear(GL_COLOR_BUFFER_BIT); if (!$self->GetParent->enabled || !$self->layers) { - glFlush(); $self->SwapBuffers; return; } @@ -486,7 +485,6 @@ sub Render { } gluDeleteTess($tess) if $tess; - glFlush(); $self->SwapBuffers; } |