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