2 ms·
Hm, doesn't the glBufferSubData update the one and the same bit of memory on gpu, having the driver wait for the draws that dependent on the previous values to
by scoopr 11y ago
Hm, doesn't the glBufferSubData update the one and the same bit of memory on gpu, having the driver wait for the draws that dependent on the previous values to go through, before letting the update values through. You could use glBufferData allocate a new bit memory (with NULL ptr it would just be discarding the old values).
Other ways would be to fill a bigger buffer with all the different uniform values at once, and then pointing to right bits of it with the drawcalls.
- sharpneli 11y agoYeah. glBufferData should work fine in this case. To be honest the Windows OpenGL drivers are the ones at fault here. Instead of reusing the old data store they seem to allocate a new one, just what glBufferData does. However the performance improvement for glBufferSubData implemented correctly is not enough to offset the huge amount of code that relies on glBufferSubData to behave like glBufferData. So I can see why a driver developer has opted to this behavior.