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
qsgrhishadereffectnode_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSGRHISHADEREFFECTNODE_P_H
5#define QSGRHISHADEREFFECTNODE_P_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 <private/qsgadaptationlayer_p.h>
19#include <qsgmaterial.h>
20#include <QUrl>
21
23
25class QSGPlainTexture;
27class QFileSelector;
28
30{
31public:
32 void reset(const QShader &vs, const QShader &fs);
33
34 void feedConstants(const QSGShaderEffectNode::ShaderData &shader, const QSet<int> *dirtyIndices = nullptr);
35 void feedSamplers(const QSGShaderEffectNode::ShaderData &shader, const QSet<int> *dirtyIndices = nullptr);
37
38 void dump();
39
49
50 bool m_error;
53 QHash<uint, Constant> m_constants; // offset -> Constant
54 QHash<int, QVariant> m_samplers; // binding -> value (source ref)
55 QHash<QByteArray, int> m_samplerNameMap; // name -> binding
57};
58
60
90
92{
94
95public:
97
98 QRectF updateNormalizedTextureSubRect(bool supportsAtlasTextures) override;
99 void syncMaterial(SyncData *syncData) override;
100 void preprocess() override;
101
102 static void resetMaterialTypeCache(void *materialTypeCacheKey);
103 static void garbageCollectMaterialTypeCache(void *materialTypeCacheKey);
104
105private Q_SLOTS:
106 void handleTextureChange();
107 void handleTextureProviderDestroyed(QObject *object);
108
109private:
111};
112
114{
115public:
116 bool hasSeparateSamplerAndTextureObjects() const override;
117 QString log() const override;
118 Status status() const override;
119 void prepareShaderCode(ShaderInfo::Type typeHint, const QUrl &src, ShaderInfo *result) override;
120
121private:
122 bool reflect(ShaderInfo *result);
123 Status m_status = Uncompiled;
124 QFileSelector *m_fileSelector = nullptr;
125};
126
128
129#endif // QSGRHISHADEREFFECTNODE_P_H
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qrect.h:484
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
Definition qsgmaterial.h:15
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
void prepareShaderCode(ShaderInfo::Type typeHint, const QUrl &src, ShaderInfo *result) override
bool hasSeparateSamplerAndTextureObjects() const override
QVector< QSGTextureProvider * > m_textureProviders
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
QSGRhiShaderEffectMaterial(QSGRhiShaderEffectNode *node)
bool usesSubRectUniform(int binding) const
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 befo...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
QSGRhiShaderEffectNode * m_node
QSGShaderEffectNode::CullMode m_cullMode
void updateTextureProviders(bool layoutChange)
void preprocess() override
Override this function to do processing on the node before it is rendered.
static void garbageCollectMaterialTypeCache(void *materialTypeCacheKey)
QRectF updateNormalizedTextureSubRect(bool supportsAtlasTextures) override
QSGRhiShaderEffectNode(QSGDefaultRenderContext *rc)
void syncMaterial(SyncData *syncData) override
static void resetMaterialTypeCache(void *materialTypeCacheKey)
void feedSamplers(const QSGShaderEffectNode::ShaderData &shader, const QSet< int > *dirtyIndices=nullptr)
QHash< QByteArray, int > m_samplerNameMap
QHash< uint, Constant > m_constants
QHash< int, QVariant > m_samplers
void feedConstants(const QSGShaderEffectNode::ShaderData &shader, const QSet< int > *dirtyIndices=nullptr)
bool contains(const T &value) const
Definition qset.h:71
\inmodule QtGui
Definition qshader.h:81
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum src
GLboolean reset
const GLubyte * c
GLuint shader
Definition qopenglext.h:665
GLuint64EXT * result
[6]
QDebug operator<<(QDebug debug, const QSGRhiShaderLinker::Constant &c)
#define Q_OBJECT
#define Q_SLOTS
unsigned int uint
Definition qtypes.h:34
QSharedPointer< T > other(t)
[5]
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.
QSGShaderEffectNode::VariableData::SpecialType specialType
bool operator==(const Constant &other) const