diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-06-15 15:17:32 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-06-22 08:54:40 +0000 |
commit | 7de18e6f52d6247bddd7bfabe0b2601d7db239b5 (patch) | |
tree | 4fb4df87bf129fe399734a4eccf97cfe61de5671 /src/quick/scenegraph/qsgadaptationlayer_p.h | |
parent | a03eb67a786788511302a8ac3ecc809002408fed (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/scenegraph/qsgadaptationlayer_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h index 8fdcf7af64..179ec3e3fa 100644 --- a/src/quick/scenegraph/qsgadaptationlayer_p.h +++ b/src/quick/scenegraph/qsgadaptationlayer_p.h @@ -273,9 +273,10 @@ public: uint constantDataSize; }; - virtual bool reflect(const QByteArray &src, ShaderInfo *result) = 0; + virtual void prepareShaderCode(ShaderInfo::Type typeHint, const QByteArray &src, ShaderInfo *result) = 0; Q_SIGNALS: + void shaderCodePrepared(bool ok, ShaderInfo::Type typeHint, const QByteArray &src, ShaderInfo *result); void textureChanged(); void logAndStatusChanged(); }; @@ -536,7 +537,8 @@ inline bool QSGDistanceFieldGlyphCache::containsGlyph(glyph_t glyph) return glyphData(glyph).texCoord.isValid(); } - QT_END_NAMESPACE +Q_DECLARE_METATYPE(QSGGuiThreadShaderEffectManager::ShaderInfo::Type) + #endif |