Closed hajimehoshi closed 2 months ago
By this optimization, write-pixels
will be increased. In the worst case, each new write-pixels
will be interleaved into draw-triangles
. This would degrade performance. In order to avoid this, we would have to reorder draw calls by accumulating write-pixels
first.
EDIT: This optimization has been already implemented!
Tricky things are:
backend
doesn't know what images are on. So it is not possible to iterate them.WriteImage
can be called for a part of an image. How should we hold pixels cache?
Operating System
What feature would you like to be added?
In order to reduce GPU memory, deallocate GPU memory for an image that is unused as a source for a while. We can put the memory back to GPU memory whenever necessary. This optimization works only for a source image that has all the pixel information. (e.g. an image just after NewImageFromImage), and not for an image for offscreen.
From our experience (Odencat), if an image is not used as a source for one second, the image's GPU memory can be freed.
Why is this needed?
In order to reduce crashes due to short of GPU memory. We have confirmed this happens on mobiles, and also could happen on Windows.