Is it correct that dynamic uniform buffers can only be used once per frame with the QRhi rendering layer (https://doc.qt.io/qt-6/qrhiresourceupdatebatch.html#updateDynamicBuffer)?
For instance, this will not work because the last assigned value to mvp
will be visible to all draw()
calls:
QRhiCommandBuffer *cb = swapChain->currentFrameCommandBuffer();
QRhiResourceUpdateBatch *resUpdates = rhi->nextResourceUpdateBatch();
QRhiBuffer* ubuf = ...;
cb->beginPass(...);
for (int i=0; i<100; i++)
{
mvp = ...;
resUpdates->updateDynamicBuffer(ubuf, 0, 64, mvp.constData());
cb->draw(...);
}
cb->endPass();
Do I have to create an uniform buffer for each possible mvp
value (which can result in a lot of buffers)? Or is there a better way?
Regards,
1