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
qssgrendercustommaterial_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_CUSTOM_MATERIAL_H
6#define QSSG_RENDER_CUSTOM_MATERIAL_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qurl.h>
20#include <QtCore/qvariant.h>
21#include <QtCore/qvector.h>
22#include <rhi/qrhi.h>
23
24#include <QtQuick3DRuntimeRender/qtquick3druntimerenderexports.h>
25#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
26#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
27
29
30struct QSSGRenderImage;
33class QQuick3DTexture;
34
35struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderCustomMaterial : public QSSGRenderGraphObject
36{
39
60 using TexturePropertyList = QList<TextureProperty>;
61
62 struct Property
63 {
64 Property() = default;
65 Property(const QByteArray &name, const QVariant &value, QSSGRenderShaderValue::Type shaderDataType, int pid = -1)
66 : name(name), value(value), shaderDataType(shaderDataType), pid(pid)
67 { }
71 int pid;
72 };
73 using PropertyList = QList<Property>;
74
75 enum class Flags : quint8
76 {
77 Dirty = 0x1,
78 AlwaysDirty = 0x2
79 };
80 using FlagT = std::underlying_type_t<Flags>;
81
82 enum class ShadingMode // must match QQuick3DCustomMaterial::ShadingMode
83 {
84 Unshaded,
85 Shaded
86 };
87
89 Vertex = 1 << 0,
90 Fragment = 1 << 1
91 };
92 Q_DECLARE_FLAGS(CustomShaderPresence, CustomShaderPresenceFlag)
93
94 enum class RenderFlag {
95 Blending = 1 << 0,
96 ScreenTexture = 1 << 1,
97 DepthTexture = 1 << 2,
98 AoTexture = 1 << 3,
99 OverridesPosition = 1 << 4,
100 ProjectionMatrix = 1 << 5,
101 InverseProjectionMatrix = 1 << 6,
102 ScreenMipTexture = 1 << 7,
103 VarColor = 1 << 8,
104 IblOrientation = 1 << 9,
105 Lightmap = 1 << 10,
106 Skinning = 1 << 11,
107 Morphing = 1 << 12,
108 ViewIndex = 1 << 13
109 };
110 Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
111
112 enum {
113 RegularShaderPathKeyIndex = 0,
114 MultiViewShaderPathKeyIndex = 1
115 };
116 QByteArray m_shaderPathKey[2];
117 CustomShaderPresence m_customShaderPresence;
118
121
122 QSSGRenderImage *m_iblProbe = nullptr;
123 QSSGRenderImage *m_emissiveMap = nullptr;
126 RenderFlags m_renderFlags;
131 float m_lineWidth = 1.0f;
132
133 QSSGRenderGraphObject *m_nextSibling = nullptr;
134
135 ShadingMode m_shadingMode = ShadingMode::Shaded;
136
137 FlagT m_flags { FlagT(Flags::Dirty) };
138 bool incompleteBuildTimeObject = false; // Used by the shadergen tool
139 bool m_usesSharedVariables = false;
140
141 void markDirty();
142 void clearDirty();
143 void setAlwaysDirty(bool v);
144 [[nodiscard]] inline bool isDirty() const { return ((m_flags & (FlagT(Flags::Dirty) | FlagT(Flags::AlwaysDirty))) != 0); }
145
146 QSSGShaderMaterialAdapter *adapter = nullptr;
147
149};
150
151
152
153Q_DECLARE_OPERATORS_FOR_FLAGS(QSSGRenderCustomMaterial::CustomShaderPresence)
154
156
157#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
BlendFactor
Specifies the blend factor.
Definition qrhi.h:1309
\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]
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLsizei const GLfloat * v
[13]
GLuint name
QSSGRenderTextureCoordOp
QSSGRenderTextureFilterOp
unsigned char quint8
Definition qtypes.h:46
Property(const QByteArray &name, const QVariant &value, QSSGRenderShaderValue::Type shaderDataType, int pid=-1)
CustomShaderPresence m_customShaderPresence
QRhiGraphicsPipeline::BlendFactor m_srcBlend
std::underlying_type_t< Flags > FlagT
QRhiGraphicsPipeline::BlendFactor m_dstBlend
QRhiGraphicsPipeline::BlendFactor m_dstAlphaBlend
QRhiGraphicsPipeline::BlendFactor m_srcAlphaBlend
\qmltype MapCircle \instantiates QDeclarativeCircleMapItem \inqmlmodule QtLocation