mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:01:15 +02:00
Disable chromium distance field text rendering on ATI GPUs
This commit is contained in:
parent
aa19794a94
commit
e7e9ca4b2b
1 changed files with 54 additions and 38 deletions
|
@ -2614,10 +2614,55 @@ void Application::initializeGL() {
|
||||||
_isGLInitialized = true;
|
_isGLInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glWidget->makeCurrent();
|
if (!_glWidget->makeCurrent()) {
|
||||||
glClearColor(0.2f, 0.2f, 0.2f, 1);
|
qCWarning(interfaceapp, "Unable to make window context current");
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
}
|
||||||
_glWidget->swapBuffers();
|
|
||||||
|
#if !defined(DISABLE_QML)
|
||||||
|
// Build a shared canvas / context for the Chromium processes
|
||||||
|
{
|
||||||
|
// Disable signed distance field font rendering on ATI/AMD GPUs, due to
|
||||||
|
// https://highfidelity.manuscript.com/f/cases/13677/Text-showing-up-white-on-Marketplace-app
|
||||||
|
std::string vendor{ (const char*)glGetString(GL_VENDOR) };
|
||||||
|
if ((vendor.find("AMD") != std::string::npos) || (vendor.find("ATI") != std::string::npos)) {
|
||||||
|
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--disable-distance-field-text"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chromium rendering uses some GL functions that prevent nSight from capturing
|
||||||
|
// frames, so we only create the shared context if nsight is NOT active.
|
||||||
|
if (!nsightActive()) {
|
||||||
|
_chromiumShareContext = new OffscreenGLCanvas();
|
||||||
|
_chromiumShareContext->setObjectName("ChromiumShareContext");
|
||||||
|
_chromiumShareContext->create(_glWidget->qglContext());
|
||||||
|
if (!_chromiumShareContext->makeCurrent()) {
|
||||||
|
qCWarning(interfaceapp, "Unable to make chromium shared context current");
|
||||||
|
}
|
||||||
|
qt_gl_set_global_share_context(_chromiumShareContext->getContext());
|
||||||
|
_chromiumShareContext->doneCurrent();
|
||||||
|
// Restore the GL widget context
|
||||||
|
if (!_glWidget->makeCurrent()) {
|
||||||
|
qCWarning(interfaceapp, "Unable to make window context current");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qCWarning(interfaceapp) << "nSight detected, disabling chrome rendering";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Build a shared canvas / context for the QML rendering
|
||||||
|
{
|
||||||
|
_qmlShareContext = new OffscreenGLCanvas();
|
||||||
|
_qmlShareContext->setObjectName("QmlShareContext");
|
||||||
|
_qmlShareContext->create(_glWidget->qglContext());
|
||||||
|
if (!_qmlShareContext->makeCurrent()) {
|
||||||
|
qCWarning(interfaceapp, "Unable to make QML shared context current");
|
||||||
|
}
|
||||||
|
OffscreenQmlSurface::setSharedContext(_qmlShareContext->getContext());
|
||||||
|
_qmlShareContext->doneCurrent();
|
||||||
|
if (!_glWidget->makeCurrent()) {
|
||||||
|
qCWarning(interfaceapp, "Unable to make window context current");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Build an offscreen GL context for the main thread.
|
// Build an offscreen GL context for the main thread.
|
||||||
_offscreenContext = new OffscreenGLCanvas();
|
_offscreenContext = new OffscreenGLCanvas();
|
||||||
|
@ -2629,6 +2674,11 @@ void Application::initializeGL() {
|
||||||
_offscreenContext->doneCurrent();
|
_offscreenContext->doneCurrent();
|
||||||
_offscreenContext->setThreadContext();
|
_offscreenContext->setThreadContext();
|
||||||
|
|
||||||
|
_glWidget->makeCurrent();
|
||||||
|
glClearColor(0.2f, 0.2f, 0.2f, 1);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
_glWidget->swapBuffers();
|
||||||
|
|
||||||
// Move the GL widget context to the render event handler thread
|
// Move the GL widget context to the render event handler thread
|
||||||
_renderEventHandler = new RenderEventHandler(_glWidget->qglContext());
|
_renderEventHandler = new RenderEventHandler(_glWidget->qglContext());
|
||||||
if (!_offscreenContext->makeCurrent()) {
|
if (!_offscreenContext->makeCurrent()) {
|
||||||
|
@ -2751,40 +2801,6 @@ extern void setupPreferences();
|
||||||
static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, int index, bool active = false);
|
static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, int index, bool active = false);
|
||||||
|
|
||||||
void Application::initializeUi() {
|
void Application::initializeUi() {
|
||||||
// Build a shared canvas / context for the Chromium processes
|
|
||||||
#if !defined(DISABLE_QML)
|
|
||||||
// Chromium rendering uses some GL functions that prevent nSight from capturing
|
|
||||||
// frames, so we only create the shared context if nsight is NOT active.
|
|
||||||
if (!nsightActive()) {
|
|
||||||
_chromiumShareContext = new OffscreenGLCanvas();
|
|
||||||
_chromiumShareContext->setObjectName("ChromiumShareContext");
|
|
||||||
_chromiumShareContext->create(_offscreenContext->getContext());
|
|
||||||
if (!_chromiumShareContext->makeCurrent()) {
|
|
||||||
qCWarning(interfaceapp, "Unable to make chromium shared context current");
|
|
||||||
}
|
|
||||||
qt_gl_set_global_share_context(_chromiumShareContext->getContext());
|
|
||||||
_chromiumShareContext->doneCurrent();
|
|
||||||
// Restore the GL widget context
|
|
||||||
_offscreenContext->makeCurrent();
|
|
||||||
} else {
|
|
||||||
qCWarning(interfaceapp) << "nSIGHT detected, disabling chrome rendering";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Build a shared canvas / context for the QML rendering
|
|
||||||
_qmlShareContext = new OffscreenGLCanvas();
|
|
||||||
_qmlShareContext->setObjectName("QmlShareContext");
|
|
||||||
_qmlShareContext->create(_offscreenContext->getContext());
|
|
||||||
if (!_qmlShareContext->makeCurrent()) {
|
|
||||||
qCWarning(interfaceapp, "Unable to make QML shared context current");
|
|
||||||
}
|
|
||||||
OffscreenQmlSurface::setSharedContext(_qmlShareContext->getContext());
|
|
||||||
_qmlShareContext->doneCurrent();
|
|
||||||
// Restore the GL widget context
|
|
||||||
_offscreenContext->makeCurrent();
|
|
||||||
// Make sure all QML surfaces share the main thread GL context
|
|
||||||
OffscreenQmlSurface::setSharedContext(_offscreenContext->getContext());
|
|
||||||
|
|
||||||
AddressBarDialog::registerType();
|
AddressBarDialog::registerType();
|
||||||
ErrorDialog::registerType();
|
ErrorDialog::registerType();
|
||||||
LoginDialog::registerType();
|
LoginDialog::registerType();
|
||||||
|
|
Loading…
Reference in a new issue