Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qsgrhishadereffectnode_p.h>
Public Member Functions | |
QSGRhiShaderEffectMaterial (QSGRhiShaderEffectNode *node) | |
~QSGRhiShaderEffectMaterial () | |
int | compare (const QSGMaterial *other) const override |
Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before. | |
QSGMaterialType * | type () const override |
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader(). | |
QSGMaterialShader * | createShader (QSGRendererInterface::RenderMode renderMode) const override |
This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial. | |
void | updateTextureProviders (bool layoutChange) |
bool | usesSubRectUniform (int binding) const |
Public Member Functions inherited from QSGMaterial | |
QSGMaterial () | |
virtual | ~QSGMaterial () |
QSGMaterial::Flags | flags () const |
Returns the material's flags. | |
void | setFlag (Flags flags, bool on=true) |
Sets the flags flags on this material if on is true; otherwise clears the attribute. | |
int | viewCount () const |
Static Public Attributes | |
static const int | MAX_BINDINGS = 32 |
Additional Inherited Members | |
Public Types inherited from QSGMaterial | |
enum | Flag { Blending = 0x0001 , RequiresDeterminant = 0x0002 , RequiresFullMatrixExceptTranslate = 0x0004 | RequiresDeterminant , RequiresFullMatrix = 0x0008 | RequiresFullMatrixExceptTranslate , NoBatching = 0x0010 , MultiView2 = 0x10000 , MultiView3 = 0x20000 , MultiView4 = 0x40000 } |
\value Blending Set this flag to true if the material requires blending to be enabled during rendering. More... | |
Definition at line 61 of file qsgrhishadereffectnode_p.h.
QSGRhiShaderEffectMaterial::QSGRhiShaderEffectMaterial | ( | QSGRhiShaderEffectNode * | node | ) |
Definition at line 515 of file qsgrhishadereffectnode.cpp.
References QSGMaterial::Blending, QSGMaterial::RequiresFullMatrix, and QSGMaterial::setFlag().
QSGRhiShaderEffectMaterial::~QSGRhiShaderEffectMaterial | ( | ) |
Definition at line 521 of file qsgrhishadereffectnode.cpp.
References m_dummyTexture, m_fragmentShader, m_materialType, m_materialTypeCacheKey, m_vertexShader, and shaderMaterialTypeCache.
|
overridevirtual |
Compares this material to other and returns 0 if they are equal; -1 if this material should sort before other and 1 if other should sort before.
The scene graph can reorder geometry nodes to minimize state changes. The compare function is called during the sorting process so that the materials can be sorted to minimize state changes in each call to QSGMaterialShader::updateState().
The this pointer and other is guaranteed to have the same type().
Reimplemented from QSGMaterial.
Definition at line 538 of file qsgrhishadereffectnode.cpp.
References hasAtlasTexture(), QSGRhiShaderLinker::m_constants, m_cullMode, m_geometryUsesTextureSubRect, m_linker, m_textureProviders, o, other(), Q_ASSERT, t2, and type().
|
overridevirtual |
This function returns a new instance of a the QSGMaterialShader implementation used to render geometry for a specific implementation of QSGMaterial.
The function will be called only once for each combination of material type and renderMode and will be cached internally.
For most materials, the renderMode can be ignored. A few materials may need custom handling for specific render modes. For instance if the material implements antialiasing in a way that needs to account for perspective transformations when RenderMode3D is in use.
Implements QSGMaterial.
Definition at line 590 of file qsgrhishadereffectnode.cpp.
References Q_UNUSED.
|
overridevirtual |
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialShader instantiated by createShader().
For many materials, the typical approach will be to return a pointer to a static, and so globally available, QSGMaterialType instance. The QSGMaterialType is an opaque object. Its purpose is only to serve as a type-safe, simple way to generate unique material identifiers.
Implements QSGMaterial.
Definition at line 585 of file qsgrhishadereffectnode.cpp.
References m_materialType.
Referenced by compare().
void QSGRhiShaderEffectMaterial::updateTextureProviders | ( | bool | layoutChange | ) |
Definition at line 596 of file qsgrhishadereffectnode.cpp.
References QObject::connect(), QHash< Key, T >::constBegin(), QHash< Key, T >::constEnd(), QThread::currentThread(), QObject::disconnect(), it, m_linker, m_node, QSGRhiShaderLinker::m_samplers, m_textureProviders, MAX_BINDINGS, Q_ASSERT_X, qobject_cast< QQuickItem * >(), qWarning, SIGNAL, SLOT, and typeName.
Referenced by QSGRhiShaderEffectNode::syncMaterial().
|
inline |
Definition at line 73 of file qsgrhishadereffectnode_p.h.
References QSet< T >::contains(), m_linker, and QSGRhiShaderLinker::m_subRectBindings.
QSGShaderEffectNode::CullMode QSGRhiShaderEffectMaterial::m_cullMode = QSGShaderEffectNode::NoCulling |
Definition at line 83 of file qsgrhishadereffectnode_p.h.
Referenced by compare(), and QSGRhiShaderEffectNode::syncMaterial().
QSGPlainTexture* QSGRhiShaderEffectMaterial::m_dummyTexture = nullptr |
Definition at line 88 of file qsgrhishadereffectnode_p.h.
Referenced by ~QSGRhiShaderEffectMaterial().
QShader QSGRhiShaderEffectMaterial::m_fragmentShader |
Definition at line 87 of file qsgrhishadereffectnode_p.h.
Referenced by QSGRhiShaderEffectMaterialShader::QSGRhiShaderEffectMaterialShader(), ~QSGRhiShaderEffectMaterial(), and QSGRhiShaderEffectNode::syncMaterial().
bool QSGRhiShaderEffectMaterial::m_geometryUsesTextureSubRect = false |
Definition at line 82 of file qsgrhishadereffectnode_p.h.
Referenced by compare(), and QSGRhiShaderEffectNode::updateNormalizedTextureSubRect().
bool QSGRhiShaderEffectMaterial::m_hasCustomFragmentShader = false |
Definition at line 85 of file qsgrhishadereffectnode_p.h.
Referenced by QSGRhiShaderEffectNode::syncMaterial().
bool QSGRhiShaderEffectMaterial::m_hasCustomVertexShader = false |
Definition at line 84 of file qsgrhishadereffectnode_p.h.
Referenced by QSGRhiShaderEffectNode::syncMaterial().
QSGRhiShaderLinker QSGRhiShaderEffectMaterial::m_linker |
Definition at line 80 of file qsgrhishadereffectnode_p.h.
Referenced by compare(), QSGRhiShaderEffectNode::syncMaterial(), updateTextureProviders(), and usesSubRectUniform().
QSGMaterialType* QSGRhiShaderEffectMaterial::m_materialType = nullptr |
Definition at line 78 of file qsgrhishadereffectnode_p.h.
Referenced by ~QSGRhiShaderEffectMaterial(), QSGRhiShaderEffectNode::syncMaterial(), and type().
Definition at line 79 of file qsgrhishadereffectnode_p.h.
Referenced by ~QSGRhiShaderEffectMaterial(), and QSGRhiShaderEffectNode::syncMaterial().
QSGRhiShaderEffectNode* QSGRhiShaderEffectMaterial::m_node |
Definition at line 77 of file qsgrhishadereffectnode_p.h.
Referenced by updateTextureProviders().
QVector<QSGTextureProvider *> QSGRhiShaderEffectMaterial::m_textureProviders |
Definition at line 81 of file qsgrhishadereffectnode_p.h.
Referenced by compare(), QSGRhiShaderEffectNode::preprocess(), QSGRhiShaderEffectNode::updateNormalizedTextureSubRect(), and updateTextureProviders().
QShader QSGRhiShaderEffectMaterial::m_vertexShader |
Definition at line 86 of file qsgrhishadereffectnode_p.h.
Referenced by QSGRhiShaderEffectMaterialShader::QSGRhiShaderEffectMaterialShader(), ~QSGRhiShaderEffectMaterial(), and QSGRhiShaderEffectNode::syncMaterial().
|
static |
Definition at line 75 of file qsgrhishadereffectnode_p.h.
Referenced by QSGRhiShaderEffectMaterialShader::updateSampledImage(), updateTextureProviders(), and QSGRhiShaderEffectMaterialShader::updateUniformData().