aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickgenericshadereffect_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-06-15 15:17:32 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-06-22 08:54:40 +0000
commit7de18e6f52d6247bddd7bfabe0b2601d7db239b5 (patch)
tree4fb4df87bf129fe399734a4eccf97cfe61de5671 /src/quick/items/qquickgenericshadereffect_p.h
parenta03eb67a786788511302a8ac3ecc809002408fed (diff)
D3D12: Support runtime threaded shader compilation
Let's revise our policy of offline/bytecode only shaders. ShaderEffect benefits greatly from having runtime compilation support for HLSL source strings, especially when dynamically constructing shader strings. There is no reason not to support both approaches since we rely on d3dcompiler for reflection anyhow. What's more, we can call D3DCompile on a dedicated thread, keeping the gui responsive while compilation is on-going. Change-Id: Ie6c02c2aa0ebd0c8371bbf30b3ce6582128c457b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickgenericshadereffect_p.h')
-rw-r--r--src/quick/items/qquickgenericshadereffect_p.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quick/items/qquickgenericshadereffect_p.h b/src/quick/items/qquickgenericshadereffect_p.h
index ab17a7fb87..5ec83eb60f 100644
--- a/src/quick/items/qquickgenericshadereffect_p.h
+++ b/src/quick/items/qquickgenericshadereffect_p.h
@@ -103,6 +103,8 @@ private slots:
void markGeometryDirtyAndUpdateIfSupportsAtlas();
void itemWindowChanged(QQuickWindow *w);
void backendChanged();
+ void shaderCodePrepared(bool ok, QSGGuiThreadShaderEffectManager::ShaderInfo::Type typeHint,
+ const QByteArray &src, QSGGuiThreadShaderEffectManager::ShaderInfo *result);
private:
QSGGuiThreadShaderEffectManager *shaderEffectManager() const;
@@ -113,8 +115,9 @@ private:
NShader
};
- void updateShader(Shader which, const QByteArray &src);
- void disconnectSignals(Shader which);
+ void updateShader(Shader shaderType, const QByteArray &src);
+ void updateShaderVars(Shader shaderType);
+ void disconnectSignals(Shader shaderType);
bool sourceIsUnique(QQuickItem *source, Shader typeToSkip, int indexToSkip) const;
QQuickShaderEffect *m_item;
@@ -132,6 +135,7 @@ private:
QSGShaderEffectNode::DirtyShaderFlags m_dirty;
QSet<int> m_dirtyConstants[NShader];
QSet<int> m_dirtyTextures[NShader];
+ QSGGuiThreadShaderEffectManager::ShaderInfo *m_inProgress[NShader];
struct SignalMapper {
SignalMapper() : mapper(nullptr), active(false) { }