7#ifndef QSSG_RENDER_COMMANDS_H
8#define QSSG_RENDER_COMMANDS_H
21#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
23#include <QtQuick3DRuntimeRender/private/qssgrenderuserpass_p.h>
30struct QSSGRenderEffect;
58 QSSGCommand(CommandType inType) : m_type(inType) {}
59 virtual ~QSSGCommand();
60 const char *typeAsString()
const;
61 QString debugString()
const;
62 void addDebug(QDebug &stream)
const;
91 QSSGRenderTextureFormat inFormat,
92 QSSGRenderTextureFilterOp inFilterOp,
93 QSSGRenderTextureCoordOp inCoordOp,
116 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();
134 stream <<
"format" << m_outputFormat.toString();
151 stream <<
"name:" << m_bufferName;
170 stream <<
"key:" << m_shaderPathKey <<
"effect:";
203 stream <<
"name:" << m_propertyName <<
"type:" <<
int(m_valueType) <<
"offset:" << m_valueOffset ;
224 stream <<
"name:" << m_propertyName <<
"value:" << m_value;
238 stream <<
"name:" << m_bufferName <<
"sampler:" << m_samplerName;
257 stream <<
"(no parameters)";
281 stream <<
"layerMask:" << layerMask <<
"renderableTypes:" << renderableTypes;
302 void setTexture(
const QSSGManagedRhiTexture &tex) { m_tex = tex; }
316 stream <<
"format:" << m_format.toString();
337 stream <<
"name:" << m_name;
343 return m_textureCmd->format();
345 return QSSGRenderTextureFormat::Unknown;
367 stream <<
"name:" << m_name;
379 stream <<
"(no parameters)";
400 stream <<
"define name:" << m_name <<
"value:" << m_value;
420 stream <<
"dispatch: (" << m_groupCount.x <<
" " << m_groupCount.y <<
" " << m_groupCount.z <<
")";
435 m_userPassId = userPassId;
439 stream <<
"userPassId:" <<
static_cast<quint64>(m_userPassId);
476 stream <<
"pipelineState:" <<
"{";
477 if (m_depthTestEnabled.has_value())
478 stream <<
" depthTestEnabled:" << m_depthTestEnabled.value();
479 if (m_depthWriteEnabled.has_value())
480 stream <<
" depthWriteEnabled:" << m_depthWriteEnabled.value();
481 if (m_blendEnabled.has_value())
482 stream <<
" blendEnabled:" << m_blendEnabled.value();
483 if (m_usesStencilReference.has_value())
484 stream <<
" usesStencilReference:" << m_usesStencilReference.value();
485 if (m_usesScissor.has_value())
486 stream <<
" usesScissor:" << m_usesScissor.value();
487 if (m_depthFunction.has_value())
488 stream <<
" depthFunction:" <<
int(m_depthFunction.value());
489 if (m_cullMode.has_value())
490 stream <<
" cullMode:" <<
int(m_cullMode.value());
491 if (m_polygonMode.has_value())
492 stream <<
" polygonMode:" <<
int(m_polygonMode.value());
493 if (m_stencilOpFrontState.has_value())
494 stream <<
" stencilOpFrontState:" <<
"{...}";
495 if (m_stencilWriteMask.has_value())
496 stream <<
" stencilWriteMask:" << m_stencilWriteMask.value();
497 if (m_stencilReference.has_value())
498 stream <<
" stencilReference:" << m_stencilReference.value();
499 if (m_viewport.has_value())
500 stream <<
" viewport:" <<
"{...}";
501 if (m_scissor.has_value())
502 stream <<
" scissor:" <<
"{...}";
503 if (m_targetBlend0.has_value())
504 stream <<
" targetBlend0:" <<
"{...}";
505 if (m_targetBlend1.has_value())
506 stream <<
" targetBlend1:" <<
"{...}";
507 if (m_targetBlend2.has_value())
508 stream <<
" targetBlend2:" <<
"{...}";
509 if (m_targetBlend3.has_value())
510 stream <<
" targetBlend3:" <<
"{...}";
511 if (m_targetBlend4.has_value())
512 stream <<
" targetBlend4:" <<
"{...}";
513 if (m_targetBlend5.has_value())
514 stream <<
" targetBlend5:" <<
"{...}";
515 if (m_targetBlend6.has_value())
516 stream <<
" targetBlend6:" <<
"{...}";
517 if (m_targetBlend7.has_value())
518 stream <<
" targetBlend7:" <<
"{...}";
QSSGAddShaderDefine(const QByteArray &name, int value=0)
void addDebug(QDebug &stream) const
void setFormat(QSSGRenderTextureFormat format)
QSSGAllocateTexture(QSSGRenderTextureFormat inFormat)
const QSSGManagedRhiTexture & texture() const
void addDebug(QDebug &stream) const
QSSGRenderTextureFormat format() const
void setTexture(const QSSGManagedRhiTexture &tex)
void addDebug(QDebug &stream) const
QSSGColorAttachment(const QByteArray &name)
QSSGAllocateTexturePtr m_textureCmd
QSSGRenderTextureFormat format() const
QSSGColorAttachment(const QByteArray &name, CommandType type)
void addDebug(QDebug &stream) const
QSSGDepthStencilAttachment()
QRhiTexture::Format m_format
void addDebug(QDebug &stream) const
QSSGDepthTextureAttachment(const QByteArray &name)
void addDebug(QDebug &stream) const
QSSGDispatch(QSSGRenderShaderValue::ivec3 groupCount)
QSSGRenderShaderValue::ivec3 m_groupCount
std::optional< bool > m_usesScissor
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend2
std::optional< QRhiGraphicsPipeline::CompareOp > m_depthFunction
std::optional< QRhiGraphicsPipeline::PolygonMode > m_polygonMode
std::optional< QRhiViewport > m_viewport
std::optional< bool > m_usesStencilReference
std::optional< quint32 > m_stencilReference
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend1
std::optional< QRhiGraphicsPipeline::StencilOpState > m_stencilOpFrontState
std::optional< bool > m_depthWriteEnabled
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend5
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend7
std::optional< QRhiGraphicsPipeline::CullMode > m_cullMode
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend4
QSSGPipelineStateOverrideCommand()
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend0
std::optional< QRhiScissor > m_scissor
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend6
std::optional< bool > m_depthTestEnabled
std::optional< QRhiGraphicsPipeline::TargetBlend > m_targetBlend3
void addDebug(QDebug &stream) const
std::optional< bool > m_blendEnabled
std::optional< quint32 > m_stencilWriteMask
friend class QSSGLayerRenderData
friend class QSSGRenderer
void addDebug(QDebug &stream) const
RenderableTypeT renderableTypes
QSSGRenderablesFilterCommand()
static constexpr RenderableTypeT AllRenderableTypes
friend class QSSGRenderContextInterface
void addDebug(QDebug &stream) const
void setSubPass(QSSGResourceId userPassId)
QSSGResourceId m_userPassId
Combined button and popup list for selecting options.
static QSet< QByteArray > shaderIdentifiers(const QByteArray &shaderCode)
void prepareComputePass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderComputePass *passNode, ComputeUserPassData &userData, QSSGPassKey key)
static const QByteArrayList rhiProperties
static const QByteArrayList cameraUniforms
static const QByteArrayList lightUniforms
static QT_BEGIN_NAMESPACE constexpr int s_maxDirectionalLights
static const QByteArrayList positionalShadows
static constexpr int s_maxPositionalLights
static QSSGRhiShaderPipelinePtr generateRhiShaderPipeline(const QByteArray &inKey, QSSGRenderContextInterface *cif, const QSSGRenderComputePass *pass, const QSSGComputeLightContext &lightContext, const bool multiview, int viewCount)
static const QByteArrayList screenTextures
bool finalizeComputeShader(QSSGUserComputeShader &computeShader)
static bool containsAny(const QSet< QByteArray > &identifiers, const QByteArrayList &list)
static quint32 softShadowQualityToInt(QSSGRenderLight::SoftShadowQuality quality)
void prepareComputePass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderComputePass *passNode, ComputeUserPassData &passData, QSSGPassKey key)
QSSGShaderDefineList m_shaderDefines
QSSGRhiShaderPipelinePtr m_computePipeline
QRhiShaderResourceBindings * m_computeBindings
QSSGRenderShaderValue::ivec3 m_groupCount
QSSGAllocateBufferFlags(quint32 inValues)
void setSceneLifetime(bool inValue)
bool isSceneLifetime() const
QSSGAllocateBufferFlags()
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)
QByteArray m_propertyName
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)
QByteArray m_propertyName
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
QByteArray m_shaderPathKey
QSSGBindShader(const QByteArray &inShaderPathKey)
QSSGBindTarget(const QSSGBindTarget &command)
QSSGRenderTextureFormat m_outputFormat
void addDebug(QDebug &stream) const
QSSGBindTarget(QSSGRenderTextureFormat inFormat=QSSGRenderTextureFormat::RGBA8)
void addDebug(QDebug &stream) const
QSSGRender(const QSSGRender &)