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>.
Loading...
Searching...
No Matches
qssgrendereffect_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
4#ifndef QSSG_RENDER_EFFECT_H
5#define QSSG_RENDER_EFFECT_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrendernode_p.h>
20
21#include <QtQuick3DRuntimeRender/private/qssgrenderimage_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrendershaderlibrarymanager_p.h>
23
24#include <QtCore/QVariant>
25
27
28struct QSSGRenderLayer;
29struct QSSGCommand;
31
32struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderEffect : public QSSGRenderGraphObject
33{
36
37 void finalizeShaders(const QSSGRenderLayer &layer, QSSGRenderContextInterface *renderContext);
38
39 enum class Flags : quint8
40 {
41 Dirty = 0x1u
42 };
43 using FlagT = std::underlying_type_t<Flags>;
44
58
59 QVector<TextureProperty> textureProperties;
60
61 struct Property
62 {
63 Property() = default;
64 Property(const QByteArray &name, const QByteArray &typeName, const QVariant &value, QSSGRenderShaderValue::Type shaderDataType, int pid = -1)
65 : name(name), typeName(typeName), value(value), shaderDataType(shaderDataType), pid(pid)
66 { }
69 mutable QVariant value;
71 int pid;
72 };
73
74 QVector<Property> properties;
75
76 QSSGRenderEffect *m_nextEffect = nullptr;
77
78 void markDirty();
79 void clearDirty();
80 [[nodiscard]] inline bool isDirty() const { return ((flags & FlagT(Flags::Dirty)) != 0); }
81
86 QVector<Command> commands;
87
88 void resetCommands();
89
90 const char *className = nullptr;
91 FlagT flags = FlagT(Flags::Dirty);
92 bool requiresDepthTexture = false;
93 bool incompleteBuildTimeObject = false; // Used by the shadergen tool
95
97 {
98 QByteArray shaderPathKeyPrefix; // to be completed in finalizeShaders
99 QByteArray vertexShaderCode[2]; // without main(), to be completed in finalizeShaders
100 QByteArray fragmentShaderCode[2]; // same here
101 QSSGCustomShaderMetaData vertexMetaData[2];
102 QSSGCustomShaderMetaData fragmentMetaData[2];
103 int bindShaderCmdIndex = 0;
104 };
105
106 struct {
107 bool valid = false;
108 QVector<ShaderPrepPassData> passes;
109 } shaderPrepData;
110
112};
113
115
116#endif
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT layer
const char * typeName
GLbitfield flags
GLuint name
QSSGRenderTextureCoordOp
QSSGRenderTextureFilterOp
QSSGRenderTextureTypeValue
unsigned char quint8
Definition qtypes.h:46
const char className[16]
[1]
Definition qwizard.cpp:100
Property(const QByteArray &name, const QByteArray &typeName, const QVariant &value, QSSGRenderShaderValue::Type shaderDataType, int pid=-1)
QSSGRenderShaderValue::Type shaderDataType
QSSGRenderShaderValue::Type shaderDataType
QSSGRenderTextureTypeValue usageType
QVector< Command > commands
QVector< Property > properties
QVector< TextureProperty > textureProperties
std::underlying_type_t< Flags > FlagT
QVector< ShaderPrepPassData > passes