aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp7
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode_p.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp
index 8c46e781e9..baf7571910 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode.cpp
@@ -43,6 +43,7 @@
#include "qsgd3d12engine_p.h"
#include <QtCore/qthreadpool.h>
#include <QtCore/qfile.h>
+#include <QtCore/qfileselector.h>
#include <QtQml/qqmlfile.h>
#include <qsgtextureprovider.h>
@@ -850,7 +851,11 @@ void QSGD3D12GuiThreadShaderEffectManager::prepareShaderCode(ShaderInfo::Type ty
// For simplicity, assume that file = bytecode, string = HLSL.
QUrl srcUrl(src);
if (!srcUrl.scheme().compare(QLatin1String("qrc"), Qt::CaseInsensitive) || srcUrl.isLocalFile()) {
- const QString fn = QQmlFile::urlToLocalFileOrQrc(src);
+ if (!m_fileSelector) {
+ m_fileSelector = new QFileSelector(this);
+ m_fileSelector->setExtraSelectors(QStringList() << QStringLiteral("hlsl"));
+ }
+ const QString fn = m_fileSelector->select(QQmlFile::urlToLocalFileOrQrc(srcUrl));
QFile f(fn);
if (!f.open(QIODevice::ReadOnly)) {
qWarning("ShaderEffect: Failed to read %s", qPrintable(fn));
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode_p.h b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode_p.h
index c36ee1a6e6..ee17e59130 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode_p.h
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12shadereffectnode_p.h
@@ -60,6 +60,7 @@ class QSGD3D12RenderContext;
class QSGD3D12GuiThreadShaderEffectManager;
class QSGD3D12ShaderEffectNode;
class QSGD3D12Texture;
+class QFileSelector;
class QSGD3D12ShaderLinker
{
@@ -166,6 +167,7 @@ private:
bool reflect(ShaderInfo *result);
QString m_log;
Status m_status = Uncompiled;
+ QFileSelector *m_fileSelector = nullptr;
friend class QSGD3D12ShaderCompileTask;
};