This is a performance patch to remove extra variable copying when looping through vertices in Image.DrawTriangles() and Image.DrawTrianglesShader().
What type of issue is this addressing?
Performance
What this PR does | solves
This PR replaces for i, v := range vertices with for i := range vertices and indexes the vertices slice to allow the functions to behave the same while avoiding unnecessarily allocating an extra ebiten.Vertex in each loop iteration.
What issue is this addressing?
This is a performance patch to remove extra variable copying when looping through vertices in
Image.DrawTriangles()
andImage.DrawTrianglesShader()
.What type of issue is this addressing?
Performance
What this PR does | solves
This PR replaces
for i, v := range vertices
withfor i := range vertices
and indexes thevertices
slice to allow the functions to behave the same while avoiding unnecessarily allocating an extraebiten.Vertex
in each loop iteration.This PR should resolve issue #3103.