summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-10-03 16:09:21 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2017-10-25 10:42:04 +0000
commitf1407493d6d25f24a3c71fbcedc00598baa44b56 (patch)
treed8c9a904f5980b1b301046e8d51593ca462994fd /examples
parenta5c4af696b4fa0747b278830d07f4360e73b1f63 (diff)
downloadqtwayland-f1407493d6d25f24a3c71fbcedc00598baa44b56.tar.gz
Support threaded rendering for Nvidia EGLStreams
Create and update the texture on the GUI thread. Make sure there is a valid context on the GUI thread: create one if necessary, and share it with the global share context. Note: this requires that threaded compositors set the Qt::AA_ShareOpenGLContexts application attribute. Task-number: QTBUG-63039 Change-Id: Ia19af0536f9df319cde84221ed53db1c2ef42293 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/minimal-qml/main.cpp3
-rw-r--r--examples/wayland/pure-qml/main.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/examples/wayland/minimal-qml/main.cpp b/examples/wayland/minimal-qml/main.cpp
index 435b4e3f..60378e86 100644
--- a/examples/wayland/minimal-qml/main.cpp
+++ b/examples/wayland/minimal-qml/main.cpp
@@ -57,6 +57,9 @@
int main(int argc, char *argv[])
{
+ // ShareOpenGLContexts is needed for using the threaded renderer
+ // on Nvidia EGLStreams
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine(QUrl("qrc:///main.qml"));
diff --git a/examples/wayland/pure-qml/main.cpp b/examples/wayland/pure-qml/main.cpp
index 304b13c4..38ed5c93 100644
--- a/examples/wayland/pure-qml/main.cpp
+++ b/examples/wayland/pure-qml/main.cpp
@@ -57,6 +57,9 @@
int main(int argc, char *argv[])
{
+ // ShareOpenGLContexts is needed for using the threaded renderer
+ // on Nvidia EGLStreams
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine(QUrl("qrc:///qml/main.qml"));