FWIW, the fixed code (thanks to github copilot)
void SpectralChannel::render(QRhiCommandBuffer *cb)
{
//update resources first
updateTextures();
Area scaledDisplayArea=convert.toScaled(displayArea);
scaledDisplayArea.moveLeft(0.);
QMatrix4x4 scaledDisplayMatrix=scaledDisplayArea.toMatrix();
resourceUpdateBatch()->updateDynamicBuffer(...);
for(QHash<LayerPtr, SpectralTextureMeta2>::iterator tex = textureList.begin(); tex != textureList.end(); tex++)
{
resourceUpdateBatch()->updateDynamicBuffer(...);
...
}
cb->resourceUpdate(resourceUpdateBatch(true));
//start drawing commands
cb->beginPass(renderTarget(), Qt::black, { 1.0f, 0 }, resourceUpdateBatch(true));
cb->setViewport({ 0, 0, float(width()*devicePixelRatio()), float(height()*devicePixelRatio()) });
for(QHash<LayerPtr, SpectralTextureMeta2>::iterator tex = textureList.begin(); tex != textureList.end(); tex++)
{
cb->setGraphicsPipeline(tex.value().spectralPipeline.get());
const QRhiCommandBuffer::VertexInput vbufBinding(tex.value().vertexBuf.get(), 0);
cb->setVertexInput(0, 1, &vbufBinding);
cb->setShaderResources();
cb->draw(4);
}
cb->endPass(updateFrameBuffer());
}