mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/atlas: potential bug fix: restore images before other image manipulations
From the reported stack trace, there could be a potential issue in atlas.BeginFrame: images were manipulated before the images are restored. Restoring images assumes that all images are not stale, but manipulating images like putOnAtlas might cause other images stale in ReplacePixels. Though we failed to reproduce the case, this fix should make sense. Updates #2075
This commit is contained in:
parent
f128f2e146
commit
928d82c685
@ -835,12 +835,17 @@ func BeginFrame(graphicsDriver graphicsdriver.Graphics) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Restore images first before other image manipulations (#2075).
|
||||
if err := restorable.RestoreIfNeeded(graphicsDriver); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resolveDeferred()
|
||||
if err := putImagesOnAtlas(graphicsDriver); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return restorable.RestoreIfNeeded(graphicsDriver)
|
||||
return nil
|
||||
}
|
||||
|
||||
func DumpImages(graphicsDriver graphicsdriver.Graphics, dir string) error {
|
||||
|
Loading…
Reference in New Issue
Block a user