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;
57 QSSGCommand(CommandType inType) : m_type(inType) {}
58 virtual ~QSSGCommand();
59 const char *typeAsString()
const;
60 QString debugString()
const;
61 void addDebug(QDebug &stream)
const;
90 QSSGRenderTextureFormat inFormat,
91 QSSGRenderTextureFilterOp inFilterOp,
92 QSSGRenderTextureCoordOp inCoordOp,
115 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();
133 stream <<
"format" << m_outputFormat.toString();
150 stream <<
"name:" << m_bufferName;
169 stream <<
"key:" << m_shaderPathKey <<
"effect:";
202 stream <<
"name:" << m_propertyName <<
"type:" <<
int(m_valueType) <<
"offset:" << m_valueOffset ;
223 stream <<
"name:" << m_propertyName <<
"value:" << m_value;
237 stream <<
"name:" << m_bufferName <<
"sampler:" << m_samplerName;
256 stream <<
"(no parameters)";
280 stream <<
"layerMask:" << layerMask <<
"renderableTypes:" << renderableTypes;
300 void setTexture(
const QSSGManagedRhiTexturePtr &tex) { m_tex = QSSGManagedRhiTexture::make_copy(tex); }
314 stream <<
"format:" << m_format.toString();
324using QSSGAllocateTexturePtr = std::shared_ptr<QSSGAllocateTexture>;
335 stream <<
"name:" << m_name;
341 return m_textureCmd->format();
343 return QSSGRenderTextureFormat::Unknown;
365 stream <<
"name:" << m_name;
377 stream <<
"(no parameters)";
398 stream <<
"define name:" << m_name <<
"value:" << m_value;
414 m_userPassId = userPassId;
418 stream <<
"userPassId:" <<
static_cast<quint64>(m_userPassId);
455 stream <<
"pipelineState:" <<
"{";
456 if (m_depthTestEnabled.has_value())
457 stream <<
" depthTestEnabled:" << m_depthTestEnabled.value();
458 if (m_depthWriteEnabled.has_value())
459 stream <<
" depthWriteEnabled:" << m_depthWriteEnabled.value();
460 if (m_blendEnabled.has_value())
461 stream <<
" blendEnabled:" << m_blendEnabled.value();
462 if (m_usesStencilReference.has_value())
463 stream <<
" usesStencilReference:" << m_usesStencilReference.value();
464 if (m_usesScissor.has_value())
465 stream <<
" usesScissor:" << m_usesScissor.value();
466 if (m_depthFunction.has_value())
467 stream <<
" depthFunction:" <<
int(m_depthFunction.value());
468 if (m_cullMode.has_value())
469 stream <<
" cullMode:" <<
int(m_cullMode.value());
470 if (m_polygonMode.has_value())
471 stream <<
" polygonMode:" <<
int(m_polygonMode.value());
472 if (m_stencilOpFrontState.has_value())
473 stream <<
" stencilOpFrontState:" <<
"{...}";
474 if (m_stencilWriteMask.has_value())
475 stream <<
" stencilWriteMask:" << m_stencilWriteMask.value();
476 if (m_stencilReference.has_value())
477 stream <<
" stencilReference:" << m_stencilReference.value();
478 if (m_viewport.has_value())
479 stream <<
" viewport:" <<
"{...}";
480 if (m_scissor.has_value())
481 stream <<
" scissor:" <<
"{...}";
482 if (m_targetBlend0.has_value())
483 stream <<
" targetBlend0:" <<
"{...}";
484 if (m_targetBlend1.has_value())
485 stream <<
" targetBlend1:" <<
"{...}";
486 if (m_targetBlend2.has_value())
487 stream <<
" targetBlend2:" <<
"{...}";
488 if (m_targetBlend3.has_value())
489 stream <<
" targetBlend3:" <<
"{...}";
490 if (m_targetBlend4.has_value())
491 stream <<
" targetBlend4:" <<
"{...}";
492 if (m_targetBlend5.has_value())
493 stream <<
" targetBlend5:" <<
"{...}";
494 if (m_targetBlend6.has_value())
495 stream <<
" targetBlend6:" <<
"{...}";
496 if (m_targetBlend7.has_value())
497 stream <<
" targetBlend7:" <<
"{...}";
QSSGAddShaderDefine(const QByteArray &name, int value=0)
void addDebug(QDebug &stream) const
void setFormat(QSSGRenderTextureFormat format)
QSSGAllocateTexture(QSSGRenderTextureFormat inFormat)
void addDebug(QDebug &stream) const
void setTexture(const QSSGManagedRhiTexturePtr &tex)
QSSGRenderTextureFormat format() const
const QSSGManagedRhiTexturePtr & texture() const
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)
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
void addDebug(QDebug &stream) const
RenderableTypeT renderableTypes
QSSGRenderablesFilterCommand()
static constexpr RenderableTypeT AllRenderableTypes
void addDebug(QDebug &stream) const
void setSubPass(QSSGResourceId userPassId)
QSSGResourceId m_userPassId
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 &)