DescriptionSupport multiple different types of data in a buffer
The current static buffer management assumes that there's only one basic set of vertex attributes in a buffer, which will all be used in one draw call. Putting multiple objects with multiple types of attributes into one buffer causes the buffer to be treated as streaming - in fact the buffer switches between streaming and static, due to the way we calculate whether it should be static.
To fix this case, instead make multiple static buffers for one vertex buffer. Each static buffer contains the data used in one draw call. When a bufferSubData occurs, only the relevant data needs to be evicted, so this can also support semi-dynamic buffers better. This change causes problems when the entire buffer has the same format but only (overlapping) portions are used in one draw call, but hopefully that case is rarer than the one addressed.
BUG=197
TEST=
Patch Set 1 #Patch Set 2 : Use std::map to find vertex offsets #
Total comments: 6
Patch Set 3 : add asserts #
MessagesTotal messages: 8
|