internal/atlas, initernal/graphics: Bug fix: Needed to reset 'notFullyUsedTime'

This commit is contained in:
Hajime Hoshi 2021-10-31 17:18:07 +09:00
parent 15f62bfeb5
commit d236d73a1f
2 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ func (t *temporaryPixels) resetAtFrameEnd() {
// Let the pixels GCed if this is not used for a while.
if t.notFullyUsedTime == maxNotFullyUsedTime && len(t.pixels) > 0 {
t.pixels = nil
t.notFullyUsedTime = 0
}
// Reset the position and reuse the allocated bytes.

View File

@ -108,6 +108,7 @@ func (v *verticesBackend) lockAndReset(f func() error) error {
if v.notFullyUsedTime == maxNotFullyUsedTime && len(v.backend) > 0 {
v.backend = nil
v.notFullyUsedTime = 0
}
v.pos = 0