72 if (renderImage.m_texture) {
73 const auto &rhiCtx = data.contextInterface()->rhiContext();
74 const auto &renderer = data.contextInterface()->renderer();
75 QRhiResourceUpdateBatch *rub = rhiCtx->rhi()->nextResourceUpdateBatch();
76 renderer->rhiQuadRenderer()->prepareQuad(rhiCtx.get(), rub);
80 virtual void render(QSSGFrameData &data)
final
82 if (renderImage.m_texture) {
83 const auto &rhiCtx = data.contextInterface()->rhiContext();
84 const auto &renderer = data.contextInterface()->renderer();
85 const auto &shaderCache = data.contextInterface()->shaderCache();
87 QSSGRhiGraphicsPipelineState ps = data.getPipelineState();
88 QRhiCommandBuffer *cb = rhiCtx->commandBuffer();
89 cb->debugMarkBegin(QByteArrayLiteral(
"QtQuick3D Blit Pass"));
91 const auto tonemapMode = QSSGLayerRenderData::getCurrent(data)->layer.tonemapMode;
92 const auto &shaderPipeline = shaderCache->getBuiltInRhiShaders().getRhiSimpleQuadShader(ps.viewCount, tonemapMode);
94 QRhiSampler *sampler = rhiCtx->sampler({ QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
95 QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge });
96 QSSGRhiShaderResourceBindingList bindings;
97 bindings.addTexture(0, QRhiShaderResourceBinding::FragmentStage, renderImage.m_texture, sampler);
98 QSSGRhiContextPrivate *rhiCtxD = QSSGRhiContextPrivate::get(rhiCtx.get());
99 QRhiShaderResourceBindings *srb = rhiCtxD->srb(bindings);
101 QSSGRhiGraphicsPipelineStatePrivate::setShaderPipeline(ps, shaderPipeline.get());
102 renderer->rhiQuadRenderer()->recordRenderQuad(rhiCtx.get(), &ps, srb, rhiCtx->mainRenderPassDescriptor(), QSSGRhiQuadRenderer::UvCoords | QSSGRhiQuadRenderer::PremulBlend);