diff options
-rw-r--r-- | src/quick/scenegraph/adaptations/d3d12/qsgd3d12builtinmaterials.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/d3d12/qsgd3d12material_p.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/scenegraph/adaptations/d3d12/qsgd3d12builtinmaterials.cpp b/src/quick/scenegraph/adaptations/d3d12/qsgd3d12builtinmaterials.cpp index 7768e114f3..ab0c98a8cd 100644 --- a/src/quick/scenegraph/adaptations/d3d12/qsgd3d12builtinmaterials.cpp +++ b/src/quick/scenegraph/adaptations/d3d12/qsgd3d12builtinmaterials.cpp @@ -507,7 +507,7 @@ QSGD3D12Material::UpdateResults QSGD3D12TextMaterial::updatePipeline(const Rende } p += TEXT_CB_SIZE_0; - if (m_lastGlyphCacheSize != glyphCache()->currentSize()) { + if (state.isCachedMaterialDataDirty() || m_lastGlyphCacheSize != glyphCache()->currentSize()) { m_lastGlyphCacheSize = glyphCache()->currentSize(); const float textureScale[2] = { 1.0f / m_lastGlyphCacheSize.width(), 1.0f / m_lastGlyphCacheSize.height() }; @@ -542,7 +542,7 @@ QSGD3D12Material::UpdateResults QSGD3D12TextMaterial::updatePipeline(const Rende } p += TEXT_CB_SIZE_3 + TEXT_CB_SIZE_4; - if (m_styleType == Styled && m_lastStyleShift != m_styleShift) { + if (m_styleType == Styled && (state.isCachedMaterialDataDirty() || m_lastStyleShift != m_styleShift)) { m_lastStyleShift = m_styleShift; const float f[2] = { m_styleShift.x(), m_styleShift.y() }; memcpy(p, f, TEXT_CB_SIZE_5); diff --git a/src/quick/scenegraph/adaptations/d3d12/qsgd3d12material_p.h b/src/quick/scenegraph/adaptations/d3d12/qsgd3d12material_p.h index 307f73bbde..e9af8e68a0 100644 --- a/src/quick/scenegraph/adaptations/d3d12/qsgd3d12material_p.h +++ b/src/quick/scenegraph/adaptations/d3d12/qsgd3d12material_p.h @@ -69,6 +69,7 @@ public: enum DirtyState { DirtyMatrix = 0x0001, DirtyOpacity = 0x0002, + DirtyCachedMaterialData = 0x0004, DirtyAll = 0xFFFF }; Q_DECLARE_FLAGS(DirtyStates, DirtyState) @@ -77,6 +78,7 @@ public: bool isMatrixDirty() const { return m_dirty & DirtyMatrix; } bool isOpacityDirty() const { return m_dirty & DirtyOpacity; } + bool isCachedMaterialDataDirty() const { return m_dirty & DirtyCachedMaterialData; } float opacity() const; QMatrix4x4 combinedMatrix() const; |