mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 11:33:07 +02:00
Merge pull request #7611 from zzmp/guard/amd
Disable gradient QML items on AMD
This commit is contained in:
commit
3f05ded932
14 changed files with 67 additions and 24 deletions
|
@ -116,7 +116,7 @@ Column {
|
||||||
|
|
||||||
LinearGradient {
|
LinearGradient {
|
||||||
id: bottomBar
|
id: bottomBar
|
||||||
visible: isCollapsible
|
visible: desktop.gradientsSupported && isCollapsible
|
||||||
width: frame.width
|
width: frame.width
|
||||||
height: visible ? 4 : 0
|
height: visible ? 4 : 0
|
||||||
x: -hifi.dimensions.contentMargin.x
|
x: -hifi.dimensions.contentMargin.x
|
||||||
|
|
|
@ -34,6 +34,10 @@ FocusScope {
|
||||||
// The VR version of the primary menu
|
// The VR version of the primary menu
|
||||||
property var rootMenu: Menu { objectName: "rootMenu" }
|
property var rootMenu: Menu { objectName: "rootMenu" }
|
||||||
|
|
||||||
|
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX/AMD
|
||||||
|
// because shaders are 4.2, and do not include #version declarations.
|
||||||
|
property bool gradientsSupported: Qt.platform.os != "osx" && !~GL.vendor.indexOf("ATI")
|
||||||
|
|
||||||
readonly property alias zLevels: zLevels
|
readonly property alias zLevels: zLevels
|
||||||
QtObject {
|
QtObject {
|
||||||
id: zLevels;
|
id: zLevels;
|
||||||
|
|
|
@ -20,6 +20,8 @@ Item {
|
||||||
|
|
||||||
default property var decoration
|
default property var decoration
|
||||||
|
|
||||||
|
property bool gradientsSupported: desktop.gradientsSupported
|
||||||
|
|
||||||
readonly property int iconSize: 22
|
readonly property int iconSize: 22
|
||||||
readonly property int frameMargin: 9
|
readonly property int frameMargin: 9
|
||||||
readonly property int frameMarginLeft: frameMargin
|
readonly property int frameMarginLeft: frameMargin
|
||||||
|
@ -59,9 +61,7 @@ Item {
|
||||||
height: 1.66 * window.height
|
height: 1.66 * window.height
|
||||||
x: (window.width - width) / 2
|
x: (window.width - width) / 2
|
||||||
y: window.height / 2 - 0.375 * height
|
y: window.height / 2 - 0.375 * height
|
||||||
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX.
|
visible: gradientsSupported && window && window.focus && pane.visible
|
||||||
// Check again when have a later version of QtQuick.
|
|
||||||
visible: window && window.focus && pane.visible && Qt.platform.os != "osx"
|
|
||||||
gradient: Gradient {
|
gradient: Gradient {
|
||||||
// GradientStop position 0.5 is at full circumference of circle that fits inside the square.
|
// GradientStop position 0.5 is at full circumference of circle that fits inside the square.
|
||||||
GradientStop { position: 0.0; color: "#ff000000" } // black, 100% opacity
|
GradientStop { position: 0.0; color: "#ff000000" } // black, 100% opacity
|
||||||
|
|
|
@ -51,6 +51,7 @@ Fadable {
|
||||||
// property bool pinnable: false
|
// property bool pinnable: false
|
||||||
// property bool pinned: false
|
// property bool pinned: false
|
||||||
property bool resizable: false
|
property bool resizable: false
|
||||||
|
property bool gradientsSupported: desktop.gradientsSupported
|
||||||
|
|
||||||
property vector2d minSize: Qt.vector2d(100, 100)
|
property vector2d minSize: Qt.vector2d(100, 100)
|
||||||
property vector2d maxSize: Qt.vector2d(1280, 800)
|
property vector2d maxSize: Qt.vector2d(1280, 800)
|
||||||
|
@ -142,9 +143,7 @@ Fadable {
|
||||||
}
|
}
|
||||||
|
|
||||||
LinearGradient {
|
LinearGradient {
|
||||||
// FIXME: Alpha gradients display as fuschia under QtQuick 2.5 on OSX.
|
visible: gradientsSupported && modality != Qt.ApplicationModal
|
||||||
// Check again when have a later version of QtQuick.
|
|
||||||
visible: modality != Qt.ApplicationModal && Qt.platform.os != "osx"
|
|
||||||
anchors.top: contentBackground.bottom
|
anchors.top: contentBackground.bottom
|
||||||
anchors.left: contentBackground.left
|
anchors.left: contentBackground.left
|
||||||
width: contentBackground.width - 1
|
width: contentBackground.width - 1
|
||||||
|
|
|
@ -1334,7 +1334,9 @@ void Application::initializeGL() {
|
||||||
|
|
||||||
InfoView::show(INFO_HELP_PATH, true);
|
InfoView::show(INFO_HELP_PATH, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void setupPreferences();
|
extern void setupPreferences();
|
||||||
|
|
||||||
void Application::initializeUi() {
|
void Application::initializeUi() {
|
||||||
AddressBarDialog::registerType();
|
AddressBarDialog::registerType();
|
||||||
ErrorDialog::registerType();
|
ErrorDialog::registerType();
|
||||||
|
@ -1346,6 +1348,9 @@ void Application::initializeUi() {
|
||||||
|
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
offscreenUi->create(_offscreenContext->getContext());
|
offscreenUi->create(_offscreenContext->getContext());
|
||||||
|
|
||||||
|
auto rootContext = offscreenUi->getRootContext();
|
||||||
|
|
||||||
offscreenUi->setProxyWindow(_window->windowHandle());
|
offscreenUi->setProxyWindow(_window->windowHandle());
|
||||||
offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
||||||
// OffscreenUi is a subclass of OffscreenQmlSurface specifically designed to
|
// OffscreenUi is a subclass of OffscreenQmlSurface specifically designed to
|
||||||
|
@ -1356,7 +1361,6 @@ void Application::initializeUi() {
|
||||||
// do better detection in the offscreen UI of what has focus
|
// do better detection in the offscreen UI of what has focus
|
||||||
offscreenUi->setNavigationFocused(false);
|
offscreenUi->setNavigationFocused(false);
|
||||||
|
|
||||||
auto rootContext = offscreenUi->getRootContext();
|
|
||||||
auto engine = rootContext->engine();
|
auto engine = rootContext->engine();
|
||||||
connect(engine, &QQmlEngine::quit, [] {
|
connect(engine, &QQmlEngine::quit, [] {
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
|
|
|
@ -44,7 +44,7 @@ int main(int argc, const char* argv[]) {
|
||||||
MiniDmpSender mpSender { BUG_SPLAT_DATABASE, BUG_SPLAT_APPLICATION_NAME, qPrintable(BuildInfo::VERSION),
|
MiniDmpSender mpSender { BUG_SPLAT_DATABASE, BUG_SPLAT_APPLICATION_NAME, qPrintable(BuildInfo::VERSION),
|
||||||
nullptr, BUG_SPLAT_FLAGS };
|
nullptr, BUG_SPLAT_FLAGS };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString applicationName = "High Fidelity Interface - " + qgetenv("USERNAME");
|
QString applicationName = "High Fidelity Interface - " + qgetenv("USERNAME");
|
||||||
|
|
||||||
bool instanceMightBeRunning = true;
|
bool instanceMightBeRunning = true;
|
||||||
|
@ -105,13 +105,14 @@ int main(int argc, const char* argv[]) {
|
||||||
// This is done separately from the main Application so that start-up and shut-down logic within the main Application is
|
// This is done separately from the main Application so that start-up and shut-down logic within the main Application is
|
||||||
// not made more complicated than it already is.
|
// not made more complicated than it already is.
|
||||||
bool override = false;
|
bool override = false;
|
||||||
QString glVersion;
|
QJsonObject glData;
|
||||||
{
|
{
|
||||||
OpenGLVersionChecker openGLVersionChecker(argc, const_cast<char**>(argv));
|
OpenGLVersionChecker openGLVersionChecker(argc, const_cast<char**>(argv));
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
glVersion = openGLVersionChecker.checkVersion(valid, override);
|
glData = openGLVersionChecker.checkVersion(valid, override);
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
if (override) {
|
if (override) {
|
||||||
|
auto glVersion = glData["version"].toString();
|
||||||
qCDebug(interfaceapp, "Running on insufficient OpenGL version: %s.", glVersion.toStdString().c_str());
|
qCDebug(interfaceapp, "Running on insufficient OpenGL version: %s.", glVersion.toStdString().c_str());
|
||||||
} else {
|
} else {
|
||||||
qCDebug(interfaceapp, "Early exit due to OpenGL version.");
|
qCDebug(interfaceapp, "Early exit due to OpenGL version.");
|
||||||
|
@ -148,12 +149,12 @@ int main(int argc, const char* argv[]) {
|
||||||
if (override) {
|
if (override) {
|
||||||
auto& accountManager = AccountManager::getInstance();
|
auto& accountManager = AccountManager::getInstance();
|
||||||
if (accountManager.isLoggedIn()) {
|
if (accountManager.isLoggedIn()) {
|
||||||
UserActivityLogger::getInstance().insufficientGLVersion(glVersion);
|
UserActivityLogger::getInstance().insufficientGLVersion(glData);
|
||||||
} else {
|
} else {
|
||||||
QObject::connect(&AccountManager::getInstance(), &AccountManager::loginComplete, [glVersion](){
|
QObject::connect(&AccountManager::getInstance(), &AccountManager::loginComplete, [glData](){
|
||||||
static bool loggedInsufficientGL = false;
|
static bool loggedInsufficientGL = false;
|
||||||
if (!loggedInsufficientGL) {
|
if (!loggedInsufficientGL) {
|
||||||
UserActivityLogger::getInstance().insufficientGLVersion(glVersion);
|
UserActivityLogger::getInstance().insufficientGLVersion(glData);
|
||||||
loggedInsufficientGL = true;
|
loggedInsufficientGL = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <QtGui/QSurfaceFormat>
|
#include <QtGui/QSurfaceFormat>
|
||||||
#include <QtOpenGL/QGL>
|
#include <QtOpenGL/QGL>
|
||||||
|
#include <QOpenGLContext>
|
||||||
|
|
||||||
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat() {
|
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat() {
|
||||||
static QSurfaceFormat format;
|
static QSurfaceFormat format;
|
||||||
|
@ -37,3 +38,21 @@ const QGLFormat& getDefaultGLFormat() {
|
||||||
});
|
});
|
||||||
return glFormat;
|
return glFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QJsonObject getGLContextData() {
|
||||||
|
if (!QOpenGLContext::currentContext()) {
|
||||||
|
return QJsonObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
||||||
|
QString glslVersion = QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||||
|
QString glVendor = QString((const char*) glGetString(GL_VENDOR));
|
||||||
|
QString glRenderer = QString((const char*)glGetString(GL_RENDERER));
|
||||||
|
|
||||||
|
return QJsonObject {
|
||||||
|
{ "version", glVersion },
|
||||||
|
{ "slVersion", glslVersion },
|
||||||
|
{ "vendor", glVendor },
|
||||||
|
{ "renderer", glRenderer },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#ifndef hifi_GLHelpers_h
|
#ifndef hifi_GLHelpers_h
|
||||||
#define hifi_GLHelpers_h
|
#define hifi_GLHelpers_h
|
||||||
|
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
// 16 bits of depth precision
|
// 16 bits of depth precision
|
||||||
#define DEFAULT_GL_DEPTH_BUFFER_BITS 16
|
#define DEFAULT_GL_DEPTH_BUFFER_BITS 16
|
||||||
// 8 bits of stencil buffer (typically you really only need 1 bit for functionality
|
// 8 bits of stencil buffer (typically you really only need 1 bit for functionality
|
||||||
|
@ -24,4 +26,6 @@ void setGLFormatVersion(F& format, int major = 4, int minor = 5) { format.setVer
|
||||||
|
|
||||||
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat();
|
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat();
|
||||||
const QGLFormat& getDefaultGLFormat();
|
const QGLFormat& getDefaultGLFormat();
|
||||||
|
QJsonObject getGLContextData();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include "OffscreenGLCanvas.h"
|
#include "OffscreenGLCanvas.h"
|
||||||
#include "GLEscrow.h"
|
#include "GLEscrow.h"
|
||||||
|
#include "GLHelpers.h"
|
||||||
|
|
||||||
|
|
||||||
// Time between receiving a request to render the offscreen UI actually triggering
|
// Time between receiving a request to render the offscreen UI actually triggering
|
||||||
|
@ -222,6 +223,11 @@ void OffscreenQmlRenderThread::init() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose GL data to QML
|
||||||
|
auto glData = getGLContextData();
|
||||||
|
auto setGL = [=]{ _surface->getRootContext()->setContextProperty("GL", glData); };
|
||||||
|
_surface->executeOnUiThread(setGL);
|
||||||
|
|
||||||
_renderControl->initialize(_canvas.getContext());
|
_renderControl->initialize(_canvas.getContext());
|
||||||
setupFbo();
|
setupFbo();
|
||||||
_escrow.setRecycler([this](GLuint texture){
|
_escrow.setRecycler([this](GLuint texture){
|
||||||
|
|
|
@ -13,16 +13,18 @@
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "GLWidget.h"
|
#include "GLWidget.h"
|
||||||
|
#include "GLHelpers.h"
|
||||||
|
|
||||||
OpenGLVersionChecker::OpenGLVersionChecker(int& argc, char** argv) :
|
OpenGLVersionChecker::OpenGLVersionChecker(int& argc, char** argv) :
|
||||||
QApplication(argc, argv)
|
QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OpenGLVersionChecker::checkVersion(bool& valid, bool& override) {
|
QJsonObject OpenGLVersionChecker::checkVersion(bool& valid, bool& override) {
|
||||||
valid = true;
|
valid = true;
|
||||||
override = false;
|
override = false;
|
||||||
|
|
||||||
|
@ -38,12 +40,12 @@ QString OpenGLVersionChecker::checkVersion(bool& valid, bool& override) {
|
||||||
messageBox.setStandardButtons(QMessageBox::Ok);
|
messageBox.setStandardButtons(QMessageBox::Ok);
|
||||||
messageBox.setDefaultButton(QMessageBox::Ok);
|
messageBox.setDefaultButton(QMessageBox::Ok);
|
||||||
messageBox.exec();
|
messageBox.exec();
|
||||||
return QString();
|
return QJsonObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve OpenGL version
|
// Retrieve OpenGL version
|
||||||
glWidget->initializeGL();
|
glWidget->initializeGL();
|
||||||
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
QJsonObject glData = getGLContextData();
|
||||||
delete glWidget;
|
delete glWidget;
|
||||||
|
|
||||||
// Compare against minimum
|
// Compare against minimum
|
||||||
|
@ -51,6 +53,8 @@ QString OpenGLVersionChecker::checkVersion(bool& valid, bool& override) {
|
||||||
// - major_number.minor_number
|
// - major_number.minor_number
|
||||||
// - major_number.minor_number.release_number
|
// - major_number.minor_number.release_number
|
||||||
// Reference: https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glGetString.xml
|
// Reference: https://www.opengl.org/sdk/docs/man/docbook4/xhtml/glGetString.xml
|
||||||
|
const QString version { "version" };
|
||||||
|
QString glVersion = glData[version].toString();
|
||||||
QStringList versionParts = glVersion.split(QRegularExpression("[\\.\\s]"));
|
QStringList versionParts = glVersion.split(QRegularExpression("[\\.\\s]"));
|
||||||
int majorNumber = versionParts[0].toInt();
|
int majorNumber = versionParts[0].toInt();
|
||||||
int minorNumber = versionParts[1].toInt();
|
int minorNumber = versionParts[1].toInt();
|
||||||
|
@ -72,5 +76,5 @@ QString OpenGLVersionChecker::checkVersion(bool& valid, bool& override) {
|
||||||
override = messageBox.exec() == QMessageBox::Ignore;
|
override = messageBox.exec() == QMessageBox::Ignore;
|
||||||
}
|
}
|
||||||
|
|
||||||
return glVersion;
|
return glData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class OpenGLVersionChecker : public QApplication {
|
||||||
public:
|
public:
|
||||||
OpenGLVersionChecker(int& argc, char** argv);
|
OpenGLVersionChecker(int& argc, char** argv);
|
||||||
|
|
||||||
static QString checkVersion(bool& valid, bool& override);
|
static QJsonObject checkVersion(bool& valid, bool& override);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_OpenGLVersionChecker_h
|
#endif // hifi_OpenGLVersionChecker_h
|
||||||
|
|
|
@ -85,11 +85,11 @@ void UserActivityLogger::launch(QString applicationVersion, bool previousSession
|
||||||
logAction(ACTION_NAME, actionDetails);
|
logAction(ACTION_NAME, actionDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLogger::insufficientGLVersion(QString glVersion) {
|
void UserActivityLogger::insufficientGLVersion(const QJsonObject& glData) {
|
||||||
const QString ACTION_NAME = "insufficient_gl";
|
const QString ACTION_NAME = "insufficient_gl";
|
||||||
QJsonObject actionDetails;
|
QJsonObject actionDetails;
|
||||||
QString GL_VERSION = "glVersion";
|
QString GL_DATA = "glData";
|
||||||
actionDetails.insert(GL_VERSION, glVersion);
|
actionDetails.insert(GL_DATA, glData);
|
||||||
|
|
||||||
logAction(ACTION_NAME, actionDetails);
|
logAction(ACTION_NAME, actionDetails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public slots:
|
||||||
|
|
||||||
void launch(QString applicationVersion, bool previousSessionCrashed, int previousSessionRuntime);
|
void launch(QString applicationVersion, bool previousSessionCrashed, int previousSessionRuntime);
|
||||||
|
|
||||||
void insufficientGLVersion(QString glVersion);
|
void insufficientGLVersion(const QJsonObject& glData);
|
||||||
|
|
||||||
void changedDisplayName(QString displayName);
|
void changedDisplayName(QString displayName);
|
||||||
void changedModel(QString typeOfModel, QString modelURL);
|
void changedModel(QString typeOfModel, QString modelURL);
|
||||||
|
@ -48,4 +48,4 @@ private:
|
||||||
bool _disabled;
|
bool _disabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_UserActivityLogger_h
|
#endif // hifi_UserActivityLogger_h
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
#include <QtQml/QtQml>
|
#include <QtQml/QtQml>
|
||||||
|
|
||||||
|
#include <gl/GLHelpers.h>
|
||||||
|
|
||||||
#include <AbstractUriHandler.h>
|
#include <AbstractUriHandler.h>
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue