diff --git a/internal/atlas/image.go b/internal/atlas/image.go index 810d9922b..070b9d736 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -64,9 +64,15 @@ func flushDeferred() { const baseCountToPutOnSourceBackend = 10 func putImagesOnSourceBackend(graphicsDriver graphicsdriver.Graphics) error { + // The counter usedAsDestinationCount is updated at most once per frame (#2676). + for i := range imagesUsedAsDestination { + i.usedAsDestinationCount++ + delete(imagesUsedAsDestination, i) + } + for i := range imagesToPutOnSourceBackend { i.usedAsSourceCount++ - if i.usedAsSourceCount >= baseCountToPutOnSourceBackend*(1<= baseCountToPutOnSourceBackend*(1<