113 if (renderImage.m_texture) {
114 const auto &rhiCtx = data.contextInterface()->rhiContext();
115 const auto &renderer = data.contextInterface()->renderer();
116 QRhiResourceUpdateBatch *rub = rhiCtx->rhi()->nextResourceUpdateBatch();
117 renderer->rhiQuadRenderer()->prepareQuad(rhiCtx.get(), rub);
121 virtual void render(QSSGFrameData &data)
final
123 if (renderImage.m_texture) {
124 const auto &rhiCtx = data.contextInterface()->rhiContext();
125 const auto &renderer = data.contextInterface()->renderer();
126 const auto &shaderCache = data.contextInterface()->shaderCache();
128 QSSGRhiGraphicsPipelineState ps = data.getPipelineState();
129 QRhiCommandBuffer *cb = rhiCtx->commandBuffer();
130 cb->debugMarkBegin(QByteArrayLiteral(
"QtQuick3D Blit Pass"));
132 const auto tonemapMode = QSSGLayerRenderData::getCurrent(data)->layer.tonemapMode;
133 const auto &shaderPipeline = shaderCache->getBuiltInRhiShaders().getRhiSimpleQuadShader(ps.viewCount, tonemapMode);
135 QRhiSampler *sampler = rhiCtx->sampler({ QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
136 QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge });
137 QSSGRhiShaderResourceBindingList bindings;
138 bindings.addTexture(0, QRhiShaderResourceBinding::FragmentStage, renderImage.m_texture, sampler);
139 QSSGRhiContextPrivate *rhiCtxD = QSSGRhiContextPrivate::get(rhiCtx.get());
140 QRhiShaderResourceBindings *srb = rhiCtxD->srb(bindings);
142 QSSGRhiGraphicsPipelineStatePrivate::setShaderPipeline(ps, shaderPipeline.get());
143 renderer->rhiQuadRenderer()->recordRenderQuad(rhiCtx.get(), &ps, srb, rhiCtx->mainRenderPassDescriptor(), QSSGRhiQuadRenderer::UvCoords | QSSGRhiQuadRenderer::PremulBlend);