shareable: Refactoring

This commit is contained in:
Hajime Hoshi 2020-11-06 00:48:32 +09:00
parent 61a8f2c69c
commit a3bccf5ff7

View File

@ -79,8 +79,8 @@ func makeImagesShared() error {
if err := i.makeShared(); err != nil {
return err
}
delete(imagesToMakeShared, i)
}
delete(imagesToMakeShared, i)
}
return nil
}
@ -382,6 +382,7 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []f
continue
}
if !src.isShared() && src.shareable() {
// src might already registered, but assiging it again is not harmful.
imagesToMakeShared[src] = struct{}{}
}
}