Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3deffect_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DEFFECT_H
7#define QQUICK3DEFFECT_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/qtquick3dglobal.h>
21#include <QtQuick3D/private/qquick3dobject_p.h>
22#include <QtQuick3D/private/qquick3dtexture_p.h>
23
24#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
25
26#include <QtQuick3DRuntimeRender/private/qssgrendercommands_p.h>
27
28#include <QtCore/qvector.h>
29
30#include <QtQuick3D/private/qquick3dshaderutils_p.h>
31
33
34class Q_QUICK3D_EXPORT QQuick3DEffect : public QQuick3DObject
35{
36 Q_OBJECT
37 Q_PROPERTY(QQmlListProperty<QQuick3DShaderUtilsRenderPass> passes READ passes)
38
39 QML_NAMED_ELEMENT(Effect)
40public:
41 explicit QQuick3DEffect(QQuick3DObject *parent = nullptr);
42
43 QQmlListProperty<QQuick3DShaderUtilsRenderPass> passes();
44
45 // Passes
46 static void qmlAppendPass(QQmlListProperty<QQuick3DShaderUtilsRenderPass> *list,
47 QQuick3DShaderUtilsRenderPass *pass);
48 static QQuick3DShaderUtilsRenderPass *qmlPassAt(QQmlListProperty<QQuick3DShaderUtilsRenderPass> *list,
49 qsizetype index);
50 static qsizetype qmlPassCount(QQmlListProperty<QQuick3DShaderUtilsRenderPass> *list);
51 static void qmlPassClear(QQmlListProperty<QQuick3DShaderUtilsRenderPass> *list);
52
53 void effectChainDirty();
54
55protected:
56 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
57 void itemChange(QQuick3DObject::ItemChange , const QQuick3DObject::ItemChangeData &) override;
58
59private Q_SLOTS:
60 void onPropertyDirty();
61 void onTextureDirty();
62 void onPassDirty();
63
64private:
65 friend class QQuick3DShaderUtilsTextureInput;
66 friend class QQuick3DSceneRenderer;
67
68 enum Dirty {
69 TextureDirty = 0x1,
70 PropertyDirty = 0x2,
71 EffectChainDirty = 0x4
72 };
73
74 void setDynamicTextureMap(QQuick3DShaderUtilsTextureInput *textureMap);
75 void markDirty(QQuick3DEffect::Dirty type);
76
77 quint32 m_dirtyAttributes = 0xffffffff;
78
79 void updateSceneManager(QQuick3DSceneManager *sceneManager);
80
81 QVector<QQuick3DShaderUtilsRenderPass *> m_passes;
82 QSet<QQuick3DShaderUtilsTextureInput *> m_dynamicTextureMaps;
83};
84
85QT_END_NAMESPACE
86
87#endif // QQUICK3DEFFECT_H
Combined button and popup list for selecting options.
static void resetShaderDependentEffectFlags(QSSGRenderEffect *effectNode)
static const char * default_effect_fragment_shader
static const char * default_effect_vertex_shader
static void insertVertexMainArgs(QByteArray &snippet)
static void accumulateEffectFlagsFromShader(QSSGRenderEffect *effectNode, const QSSGCustomShaderMetaData &meta)