2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Disable OpenGL ANGLE backend.

Currently ANGLE can work through desktop OpenGL only with enabled
attribute EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE.

Qt can't work with it enabled and shows vertically flipped content.
This commit is contained in:
John Preston
2023-08-10 14:37:55 +02:00
parent 39a80c6604
commit c5718678ea
3 changed files with 10 additions and 9 deletions

View File

@@ -737,18 +737,19 @@ void SetupANGLE(
tr::lng_settings_angle_backend_d3d11(tr::now),
tr::lng_settings_angle_backend_d3d9(tr::now),
tr::lng_settings_angle_backend_d3d11on12(tr::now),
tr::lng_settings_angle_backend_opengl(tr::now),
//tr::lng_settings_angle_backend_opengl(tr::now),
tr::lng_settings_angle_backend_disabled(tr::now),
};
const auto backendIndex = [] {
const auto disabled = int(options.size()) - 1;
const auto backendIndex = [=] {
if (Core::App().settings().disableOpenGL()) {
return 5;
return disabled;
} else switch (Ui::GL::CurrentANGLE()) {
case ANGLE::Auto: return 0;
case ANGLE::D3D11: return 1;
case ANGLE::D3D9: return 2;
case ANGLE::D3D11on12: return 3;
case ANGLE::OpenGL: return 4;
//case ANGLE::OpenGL: return 4;
}
Unexpected("Ui::GL::CurrentANGLE value in SetupANGLE.");
}();
@@ -764,7 +765,7 @@ void SetupANGLE(
return;
}
const auto confirmed = crl::guard(button, [=] {
const auto nowDisabled = (index == 5);
const auto nowDisabled = (index == disabled);
if (!nowDisabled) {
Ui::GL::ChangeANGLE([&] {
switch (index) {
@@ -772,12 +773,12 @@ void SetupANGLE(
case 1: return ANGLE::D3D11;
case 2: return ANGLE::D3D9;
case 3: return ANGLE::D3D11on12;
case 4: return ANGLE::OpenGL;
//case 4: return ANGLE::OpenGL;
}
Unexpected("Index in SetupANGLE.");
}());
}
const auto wasDisabled = (backendIndex == 5);
const auto wasDisabled = (backendIndex == disabled);
if (nowDisabled != wasDisabled) {
Core::App().settings().setDisableOpenGL(nowDisabled);
Local::writeSettings();