68 explicit QSSGRhiEffectSystem(
const std::shared_ptr<QSSGRenderContextInterface> &sgContext);
69 ~QSSGRhiEffectSystem();
71 void setup(QSize outputSize);
72 QRhiTexture *process(
const QSSGRenderLayer &layer,
73 QRhiTexture *inTexture,
74 QRhiTexture *inDepthTexture,
75 QRhiTexture *inNormalTexture,
76 QRhiTexture *inMotionVectorTexture);
78 static QSSGRenderTextureFormat::Format overriddenOutputFormat(
const QSSGRenderEffect *inEffect);
80 static QSSGRhiShaderPipelinePtr buildShaderForEffect(
const QSSGBindShader &inCmd,
81 QSSGProgramGenerator &generator,
82 QSSGShaderLibraryManager &shaderLib,
83 QSSGShaderCache &shaderCache,
84 bool isYUpInFramebuffer,
88 void releaseResources();
89 QSSGRhiEffectTexture *doRenderEffect(
const QSSGRenderEffect *inEffect,
90 QSSGRhiEffectTexture *inTexture,
93 void allocateBufferCmd(
const QSSGAllocateBuffer *inCmd, QSSGRhiEffectTexture *inTexture,
const QSSGRenderEffect *inEffect, quint8 viewCount);
94 void applyInstanceValueCmd(
const QSSGApplyInstanceValue *inCmd,
const QSSGRenderEffect *inEffect);
95 void applyValueCmd(
const QSSGApplyValue *inCmd,
const QSSGRenderEffect *inEffect);
96 void bindShaderCmd(
const QSSGBindShader *inCmd,
const QSSGRenderEffect *inEffect, quint8 viewCount);
97 void renderCmd(
const QSSGRenderEffect *inEffect, QSSGRhiEffectTexture *inTexture, QSSGRhiEffectTexture *target, quint8 viewCount);
99 void addCommonEffectUniforms(
const QSSGRenderEffect *inEffect,
const QSize &inputSize,
const QSize &outputSize, quint8 viewCount);
100 void addTextureToShaderPipeline(
const QByteArray &name, QRhiTexture *texture,
const QSSGRhiSamplerDescription &samplerDesc);
102 QSSGRhiEffectTexture *findTexture(
const QByteArray &bufferName);
103 QSSGRhiEffectTexture *getTexture(
const QByteArray &bufferName,
const QSize &size,
104 QRhiTexture::Format format,
bool isFinalOutput,
105 const QSSGRenderEffect *inEffect, quint8 viewCount);
106 void releaseTexture(QSSGRhiEffectTexture *texture);
107 void releaseTextures();
110 std::shared_ptr<QSSGRenderContextInterface> m_sgContext;
111 QVector<QSSGRhiEffectTexture *> m_textures;
112 QRhiTexture *m_depthTexture =
nullptr;
113 QRhiTexture *m_normalTexture =
nullptr;
114 QRhiTexture *m_motionVectorTexture =
nullptr;
115 QVector2D m_cameraClipRange;
116 QVarLengthArray<QMatrix4x4, 2> m_projectionMatrices;
117 QVarLengthArray<QMatrix4x4, 2> m_viewMatrices;
118 int m_currentUbufIndex = 0;
119 QHash<QSSGEffectSceneCacheKey, QSSGRhiShaderPipelinePtr> m_shaderPipelines;
120 QSSGRhiShaderPipeline *m_currentShaderPipeline =
nullptr;
121 char *m_currentUBufData =
nullptr;
122 QHash<QByteArray, QSSGRhiTexture> m_currentTextures;
123 QSet<QRhiTextureRenderTarget *> m_pendingClears;