Am I allowed to bind a single opengl buffer to multiple indexed targets (of the SSBO target) simultaneously?
For instance, suppose my shader has two different uniform blocks with different binding indexes. If the information I need is located in the same buffer, am I allowed to use glBindBufferRange
, and bind different ranges of the same buffer to these two binding indexes, simultaneously?
Another use case I see is, for instance, if I have a shader with two uniform blocks, again with different binding indexes, but this time, the only data member both uniform blocks have is an open array (with unspecified size). Am I allowed to use glBindBuffer
to bind the same buffer to both uniform blocks, and guarantee by code, to only access the array indexes within the proper range in the buffer?