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
qssgrendercommands_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_COMMANDS_H
6#define QSSG_RENDER_COMMANDS_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 <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
21
22#include <QDebug>
23#include <QVariant>
24
25QT_BEGIN_NAMESPACE
26
27struct QSSGRenderEffect;
28
41
43{
45 QSSGCommand(CommandType inType) : m_type(inType) {}
46 const char *typeAsString() const;
47 QString debugString() const;
48 void addDebug(QDebug &stream) const;
49};
50
56
58{
59 QSSGAllocateBufferFlags(quint32 inValues) : QFlags(inValues) {}
61 void setSceneLifetime(bool inValue) { setFlag(AllocateBufferFlagValues::SceneLifetime, inValue); }
62 // If isSceneLifetime is unset the buffer is assumed to be frame lifetime and will be
63 // released after this render operation.
64 bool isSceneLifetime() const { return this->operator&(AllocateBufferFlagValues::SceneLifetime); }
65};
66
68{
73 float m_sizeMultiplier = 1.0f;
76 QSSGAllocateBuffer(const QByteArray &inName,
77 QSSGRenderTextureFormat inFormat,
78 QSSGRenderTextureFilterOp inFilterOp,
79 QSSGRenderTextureCoordOp inCoordOp,
80 float inMultiplier,
83 , m_name(inName)
87 , m_sizeMultiplier(inMultiplier)
88 , m_bufferFlags(inFlags)
89 {
90 }
101 void addDebug(QDebug &stream) const {
102 stream << "name:" << m_name << "format:" << m_format.toString() << "size multiplier:" << m_sizeMultiplier << "filter:" << QSSGBaseTypeHelpers::toString(m_filterOp) << "tiling:" << QSSGBaseTypeHelpers::toString(m_texCoordOp) << "sceneLifetime:" << m_bufferFlags.isSceneLifetime();
103 }
104};
105
107{
109
110 explicit QSSGBindTarget(QSSGRenderTextureFormat inFormat = QSSGRenderTextureFormat::RGBA8)
112 {
113 }
119 void addDebug(QDebug &stream) const {
120 stream << "format" << m_outputFormat.toString();
121 }
122};
123
125{
127 QSSGBindBuffer(const QByteArray &inBufName)
129 {
130 }
136 void addDebug(QDebug &stream) const {
137 stream << "name:" << m_bufferName;
138 }
139};
140
142{
143 QByteArray m_shaderPathKey; // something like "prefix>vertex_filename>fragment_filename:source_sha:y_up_in_fbo[:tonemapping]"
144 QSSGBindShader(const QByteArray &inShaderPathKey)
147 {
148 }
155 void addDebug(QDebug &stream) const {
156 stream << "key:" << m_shaderPathKey << "effect:";
157 }
158};
159
160// The value sits immediately after the 'this' object
161// in memory.
162// If propertyName is not valid then we attempt to apply all of the effect property values
163// to the shader, ignoring ones that don't match up.
165{
166 // Name of value to apply in shader
168 // type of value
170 // offset in the effect data section of value.
172 QSSGApplyInstanceValue(const QByteArray &inName, QSSGRenderShaderValue::Type inValueType, quint32 inValueOffset)
174 {
175 }
176 // Default will attempt to apply all effect values to the currently bound shader
188 void addDebug(QDebug &stream) const {
189 stream << "name:" << m_propertyName << "type:" << int(m_valueType) << "offset:" << m_valueOffset ;
190 }
191};
192
194{
197 explicit QSSGApplyValue(const QByteArray &inName)
199 {
200 }
207 // Default will attempt to apply all effect values to the currently bound shader
209 void addDebug(QDebug &stream) const {
210 stream << "name:" << m_propertyName << "value:" << m_value;
211 }
212};
213
215{
218
219 QSSGApplyBufferValue(const QByteArray &bufferName, const QByteArray &shaderSampler)
221 {
222 }
223 void addDebug(QDebug &stream) const {
224 stream << "name:" << m_bufferName << "sampler:" << m_samplerName;
225 }
232};
233
234struct QSSGRender : public QSSGCommand
235{
237
242 void addDebug(QDebug &stream) const {
243 stream << "(no parameters)";
244 }
245};
246
247QT_END_NAMESPACE
248
249#endif
AllocateBufferFlagValues
QSSGAllocateBufferFlags(quint32 inValues)
void setSceneLifetime(bool inValue)
QSSGRenderTextureFormat m_format
QSSGAllocateBuffer(const QByteArray &inName, QSSGRenderTextureFormat inFormat, QSSGRenderTextureFilterOp inFilterOp, QSSGRenderTextureCoordOp inCoordOp, float inMultiplier, QSSGAllocateBufferFlags inFlags)
void addDebug(QDebug &stream) const
QSSGRenderTextureFilterOp m_filterOp
QSSGRenderTextureCoordOp m_texCoordOp
QSSGAllocateBufferFlags m_bufferFlags
QSSGAllocateBuffer(const QSSGAllocateBuffer &command)
void addDebug(QDebug &stream) const
QSSGApplyBufferValue(const QByteArray &bufferName, const QByteArray &shaderSampler)
QSSGApplyBufferValue(const QSSGApplyBufferValue &command)
QSSGApplyInstanceValue(const QSSGApplyInstanceValue &command)
QSSGApplyInstanceValue(const QByteArray &inName, QSSGRenderShaderValue::Type inValueType, quint32 inValueOffset)
QSSGRenderShaderValue::Type m_valueType
void addDebug(QDebug &stream) const
QSSGApplyValue(const QByteArray &inName)
void addDebug(QDebug &stream) const
QSSGApplyValue(const QSSGApplyValue &command)
void addDebug(QDebug &stream) const
QSSGBindBuffer(const QSSGBindBuffer &command)
QSSGBindBuffer(const QByteArray &inBufName)
QSSGBindShader(const QSSGBindShader &command)
void addDebug(QDebug &stream) const
QSSGBindShader(const QByteArray &inShaderPathKey)
QSSGBindTarget(const QSSGBindTarget &command)
QSSGRenderTextureFormat m_outputFormat
void addDebug(QDebug &stream) const
QSSGBindTarget(QSSGRenderTextureFormat inFormat=QSSGRenderTextureFormat::RGBA8)
const char * typeAsString() const
void addDebug(QDebug &stream) const
QString debugString() const
QSSGCommand(CommandType inType)
void addDebug(QDebug &stream) const
QSSGRender(const QSSGRender &)