Skip to content

Commit

Permalink
Enable glyph cache workaround for Apple M-family of GPUs
Browse files Browse the repository at this point in the history
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
Pick-to: 6.2 6.1 5.15 5.12
Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Laszlo Agocs <[email protected]>
  • Loading branch information
torarnv committed Jun 18, 2021
1 parent a73ec95 commit aeeaa7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/kernel/qopenglcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit aeeaa7d

Please sign in to comment.