summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-08-07 11:17:57 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-08-07 16:28:47 +0200
commit263b4a5675b966dad597fc605e2d53d1e16f6642 (patch)
treed576dcafb9dbd5aa6c9646483d1990107aac02b1 /src
parentd44ff42cf27dececb83a10dcf823393dd6b52cda (diff)
Use QSG_RHI_BACKEND instead of QT3D_RHI_DEFAULT_API
Otherwise it gets confusing having to set both when using Scene3D and taking care that they are identical. Change-Id: I4b3ab99159ff442c572554f9fb661680b46cc7bc Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/extras/defaults/qt3dwindow.cpp12
-rw-r--r--src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp
index 7f2fc8d22..f357f95a3 100644
--- a/src/extras/defaults/qt3dwindow.cpp
+++ b/src/extras/defaults/qt3dwindow.cpp
@@ -250,7 +250,7 @@ bool Qt3DWindow::event(QEvent *e)
void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept
{
// If the user pass an API through the environment, we use that over the one passed as argument.
- const auto userRequestedApi = qgetenv("QT3D_RHI_DEFAULT_API").toLower();
+ const auto userRequestedApi = qgetenv("QSG_RHI_BACKEND").toLower();
if (!userRequestedApi.isEmpty()) {
if (userRequestedApi == QByteArrayLiteral("opengl")) {
api = Qt3DRender::API::OpenGL;
@@ -272,25 +272,25 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept
switch (api)
{
case Qt3DRender::API::OpenGL:
- qputenv("QT3D_RHI_DEFAULT_API", "opengl");
+ qputenv("QSG_RHI_BACKEND", "opengl");
window->setSurfaceType(QSurface::OpenGLSurface);
break;
case Qt3DRender::API::DirectX:
- qputenv("QT3D_RHI_DEFAULT_API", "d3d11");
+ qputenv("QSG_RHI_BACKEND", "d3d11");
window->setSurfaceType(QSurface::OpenGLSurface);
break;
case Qt3DRender::API::Null:
- qputenv("QT3D_RHI_DEFAULT_API", "null");
+ qputenv("QSG_RHI_BACKEND", "null");
window->setSurfaceType(QSurface::OpenGLSurface);
break;
case Qt3DRender::API::Metal:
- qputenv("QT3D_RHI_DEFAULT_API", "metal");
+ qputenv("QSG_RHI_BACKEND", "metal");
window->setSurfaceType(QSurface::MetalSurface);
break;
#if QT_CONFIG(vulkan)
case Qt3DRender::API::Vulkan:
{
- qputenv("QT3D_RHI_DEFAULT_API", "vulkan");
+ qputenv("QSG_RHI_BACKEND", "vulkan");
window->setSurfaceType(QSurface::VulkanSurface);
window->setVulkanInstance(&Qt3DRender::staticVulkanInstance());
break;
diff --git a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp
index e1006ad42..85a6df661 100644
--- a/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/rhi/graphicshelpers/submissioncontext.cpp
@@ -546,7 +546,7 @@ void SubmissionContext::initialize()
m_ownsRhiCtx = true;
Qt3DRender::API requestedApi = Qt3DRender::API::RHI;
- const auto userRequestedApi = qgetenv("QT3D_RHI_DEFAULT_API").toLower();
+ const auto userRequestedApi = qgetenv("QSG_RHI_BACKEND").toLower();
if (!userRequestedApi.isEmpty()) {
if (userRequestedApi == QByteArrayLiteral("opengl")) {
requestedApi = Qt3DRender::API::OpenGL;