osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Reduce frequency of global UBO changes

Open smoogipoo opened this issue 1 year ago • 0 comments

Prereqs:

  • [x] https://github.com/ppy/osu-framework/pull/6186

Since the pre-req PR adds a common DrawVertices() method, we can now update the global UBO as late as possible - right before vertices need to be drawn.

The easiest way to see the difference is by using the GL renderer and noticing the reduction in the Draw.UniformUpl statistic. In TestSceneTextFlow it reduces uploads from 54 -> 28. This may lead to a minor performance increase.
The Veldrid implementation does its own similar late-upload, which could be removed but isn't done in this PR.

In general though, this should slightly increase performance (not benchmarked) just from reducing struct copies.

smoogipoo avatar Feb 19 '24 03:02 smoogipoo