From 0a33bebbba498a9df536459cdab3f2d03a184f7a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 19 Sep 2017 23:25:29 +0900 Subject: [PATCH] Updated Performance Tips (markdown) --- Performance-Tips.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Performance-Tips.md b/Performance-Tips.md index 2daebc9..f139ff8 100644 --- a/Performance-Tips.md +++ b/Performance-Tips.md @@ -2,17 +2,16 @@ The less draw commands, the better the performance is. -One drawing function like `DrawImage` or `Fill` is usually treated as one (internal) draw command, but there is an exception. Drawing commands for one image are treated as one draw command when all the below conditions are satisfied: +One drawing function like `DrawImage` or `Fill` is usually treated as one (internal) draw command, but there is an exception. Successive drawing commands are treated as one draw command when all the below conditions are satisfied: * All the functions are `DrawImage` -* All the render sources are same (`B` in `A.DrawImage(B, op)`) and not changed (no drawing commands for B). +* All the render targets are same (`A` in `A.DrawImage(B, op)`) +* All the render sources are same (`B` in `A.DrawImage(B, op)`) * All the color matrices are same * All the composite modes are same examples/sprites is a good example to draw > 10000 sprites with one draw command. -All drawing commands for one image are needed to be successive for merging so far. - # Avoid changing render sources' pixels Ebiten records almost all draw functions in order to restore when context lost happens. When a render source's pixel is changed after it is used as a render source, Ebiten tries a complicated calculation for restoring.