From f56b68b61c8ae021526c2d433961323b7e41032c Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 6 Aug 2013 13:18:19 +0100 Subject: [PATCH] Introduce QSGMaterial::CustomCompileStep Nobody reimplements the virtual QSGMaterialShader::compile() function, so we disable that code path and make it opt-in for compatibility. We do this, because opens up for that the renderer can do something different, including changing the source code to allow for better optimization. Change-Id: Ia72f9eda7d6428e26878158ab03349f753a35c66 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/scenegraph/coreapi/qsgmaterial.cpp | 5 +++++ src/quick/scenegraph/coreapi/qsgmaterial.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index c0794d0..affe357 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -601,6 +601,11 @@ QSGMaterial::~QSGMaterial() \value RequiresFullMatrix Set this flag to true if the material relies on the full matrix of the geometry nodes for rendering. + + \value CustomCompileStep Starting with Qt 5.2, the scene graph will not always call + QSGMaterialShader::compile() when its shader program is compiled and linked. + Set this flag to enforce that the function is called. + */ /*! diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index ee8889d..00970a5 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -118,7 +118,9 @@ public: Blending = 0x0001, RequiresDeterminant = 0x0002, // Allow precalculated translation and 2D rotation RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant, // Allow precalculated translation - RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate + RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate, + + CustomCompileStep = 0x0010 }; Q_DECLARE_FLAGS(Flags, Flag) -- 2.7.4