summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-06-16 20:15:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-18 17:02:30 +0000
commitc310dcce5706c284d19eb6221b231cc85c435236 (patch)
tree9b69b3d764bd716334c0820db5572eb6251518de /src
parent05ca0b37413295063701beea19e4421419d99a91 (diff)
Enable glyph cache workaround for Apple M-family of GPUs
Without the workaround, and when using a Core GL profile, we hit a code path in QSGOpenGLDistanceFieldGlyphCache::resizeTexture() that produced corrupt glyphs on M1 hardware. We fix this by enabling the workaround, so that the user doesn't have to set QT_ENABLE_GLYPH_CACHE_WORKAROUND themselves. None-Core contexts do not have this problem, but the logic in QOpenGLContext does not account for recreated contexts with different formats, so we can't limit the workaround to Core formats only. With the unified memory architecture of the M1 hardware, the workaround should have limited negative effects. In Qt 6 this is not a problem, since Qt Declarative effectively always uses the workaround code-path, but it's worth recording the fact that we need the workaround. Fixes: QTBUG-89379 Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit aeeaa7d253239b4b45e419bcad5cfde5c5714080) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qopenglcontext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 8a9cd2b85f..eef85bf0d0 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -709,7 +709,8 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
|| qstrcmp(rendererString, "GC800 core") == 0
|| qstrcmp(rendererString, "GC1000 core") == 0
|| strstr(rendererString, "GC2000") != nullptr
- || qstrcmp(rendererString, "Immersion.16") == 0;
+ || qstrcmp(rendererString, "Immersion.16") == 0
+ || qstrncmp(rendererString, "Apple Mx", 7) == 0;
}
needsWorkaroundSet = true;
}