
Originally Posted by
Alfonse Reinheart
Sure you can. You just need to employ atomic increments.
Each LOD's per-instance data is being written to a separate stream. Every time you write an instance to one of the LOD streams, you atomically increment that LODs atomic counter.
Now, atomic counters are backed by buffer object storage. But you can use glBindBufferRange, as well as the `offset` field of the atomic counter's layout specifier, to put them anywhere in a buffer object's storage. Like, say, the primCount value of an indirect rendering command.
Each counter can be set to write to the `primCount` field of a different indirect rendering command, one for each LOD. Thus, when you're finished, you have three indirect rendering commands, all ready to go.