But even for that first frame, is it noticable? Not so much. You end up with something like client arrays perf for those, which isn’t too bad. Worst case, maybe you break just the first frame after you bring up a level if you were close to breaking anyway.
Where are the textures in all this? Do you simply upload all textures there are? An then rely on GL to swap them in and out? The client arrays analogy also worries me; it means all batches need to be kept around in system memory for possible uploading.
Yes, more specifically, just append it using the Streaming VBO approach Rob Barris describes here.
But how do you keep track of which batches are in the cache and which aren’t? I’ve used std::map<BatchHash, void const*> for something similar before and it featured as a prominent time waster in the profiler report.
Maybe a part of the cache VBO is permanent and only parts are discardable?
I’ve had the following vbo layout in mind:
|
| really, really important batches
|
| streaming batches
The really, really important batches stay in there all the time, while the streaming batches are overwritten after the VBO fills up. But you probably can’t do this, because a worker thread is doing the VBO loading and you need to orphan the VBO, so the GL can still fish something out of it, that it may need.
Re alignment, I use the trick offered in that thread of just rounding offsets up to multiples of 64 or something nice. No real cost or benefit for it that I’ve seen, but you can if you want. And no problems here with dumping attributes and indices into the same VBO.
Yeah, in my test, I realigned to the 4 byte boundary. I’ve found 64 wasteful, but I am probably gonna try someday. None of the alignment stuff is particularly well documented.
Think so, but I’d round each up to a multiple of 64 (lastest-gen cache line size) just for kicks to see if that fixes your problem.
It does.
Interesting. Which card is that? I’d like to bookmark that thought.
It’s the Radeon HD 5450. The ATI drivers historically had many problems so this bug does not surprise me at all. I don’t see how it could be mine. Why would GL render new random stuff from frame to frame, even when I don’t change the viewpoint nor the geometry, i.e. I don’t change anything in the scene from frame to frame, but the results are different from frame to frame. When I change the alignment to 2 (bad performance) or 4 (good performance), the scene starts rendering correctly.