Workaround for buggy Intel HD Graphics OpenGL drivers:

Fall back to OpenGL 1.1 by a "use_legacy_opengl" preferences switch.
https://github.com/prusa3d/Slic3r/issues/233
https://github.com/prusa3d/Slic3r/issues/268
https://github.com/prusa3d/Slic3r/issues/619
This commit is contained in:
bubnikv 2017-12-11 18:00:51 +01:00
parent 61e6f23ed2
commit 743fc9dbd0
3 changed files with 24 additions and 2 deletions

View file

@ -15,7 +15,7 @@ package Slic3r::GUI::3DScene::Base;
use strict;
use warnings;
use Wx qw(:timer :bitmap :icon :dialog);
use Wx qw(wxTheApp :timer :bitmap :icon :dialog);
use Wx::Event qw(EVT_PAINT EVT_SIZE EVT_ERASE_BACKGROUND EVT_IDLE EVT_MOUSEWHEEL EVT_MOUSE_EVENTS EVT_CHAR EVT_TIMER);
# must load OpenGL *before* Wx::GLCanvas
use OpenGL qw(:glconstants :glfunctions :glufunctions :gluconstants);
@ -956,6 +956,16 @@ sub UseVBOs {
my ($self) = @_;
if (! defined ($self->{use_VBOs})) {
my $use_legacy = wxTheApp->{app_config}->get('use_legacy_opengl');
if ($use_legacy eq '1') {
# Disable OpenGL 2.0 rendering.
$self->{use_VBOs} = 0;
# Don't enable the layer editing tool.
$self->{layer_editing_enabled} = 0;
# 2 means failed
$self->{layer_editing_initialized} = 2;
return 0;
}
# This is a special path for wxWidgets on GTK, where an OpenGL context is initialized
# first when an OpenGL widget is shown for the first time. How ugly.
return 0 if (! $self->init && $^O eq 'linux');