Combine the three uniform buffers into one
...on the resource level. The shader bindings, uniform blocks all
stay the same.
Use a single resource, i.e. a single QRhiBuffer. That there are three
regions exposed as three different bindings from this same buffer,
that is fine. Binding 0 will use the first 96 bytes, whereas
what used to be in vsUniformBuffer2 comes after, it only needs an
additional offset when calculating the dynamic offsets. Finally,
place the commonUniformBuffer contents after the rest.
Building on the parent patch, we can then map (where relevant),
do a few memcpys, and then unmap, once for the whole buffer.
This will not give very obvious improvements in frame rates. The
frame captures look a lot nicer, though, especially with APIs
like D3D11. For example, with qcpainterbench and 64 items (and
a shared painter), there will now be 64 uniform buffer Map + Unmap
per frame, not 384.
Pick-to: 6.11
Change-Id: I6db6498bc803fd0df685c4ddd445d69ff95caf39
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>