internal/restorable: refactoring: remove a redundant FlushCommands call

readPixelsFromGPU already flushes commands.
This commit is contained in:
Hajime Hoshi 2022-09-13 08:42:55 -07:00
parent 49e2254e79
commit b36c21648f

View File

@ -450,9 +450,6 @@ func (i *Image) appendDrawTrianglesHistory(srcs [graphics.ShaderImageCount]*Imag
func (i *Image) readPixelsFromGPUIfNeeded(graphicsDriver graphicsdriver.Graphics) error { func (i *Image) readPixelsFromGPUIfNeeded(graphicsDriver graphicsdriver.Graphics) error {
if len(i.drawTrianglesHistory) > 0 || i.stale { if len(i.drawTrianglesHistory) > 0 || i.stale {
if err := graphicscommand.FlushCommands(graphicsDriver); err != nil {
return err
}
if err := i.readPixelsFromGPU(graphicsDriver); err != nil { if err := i.readPixelsFromGPU(graphicsDriver); err != nil {
return err return err
} }