|
|
|
|
|
by TillE
1056 days ago
|
|
Yeah I've experimented with caching vertex arrays in a scenario very similar to ImGui. It's gotta be faster when there's thousands of frames with zero changes, right? Turns out, not really. It's very easy to make performance worse like this. I'm sure you can find scenarios where it makes sense, but in general it's just not a big deal. |
|
This can work out as a net positive, because copying memory can be cheap compared to recalculating the data it contains. But if your API requires the caller to resubmit all the data on every frame, it makes no difference.
(Which is not to suggest there's anything wrong with requiring the caller to resubmit all the data, if it makes life easier for them. The worst case needs to perform well and one way of making sure it does is to make sure it's exercised all the time.)