mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/graphics: optimization: remove boundary checks
Before: ``` $ go build -gcflags="-d=ssa/check_bce" ./internal/graphics internal/graphics/vertex.go:83:9: Found IsSliceInBounds internal/graphics/vertex.go:85:5: Found IsInBounds internal/graphics/vertex.go:86:5: Found IsInBounds ... ``` After: ``` $ go build -gcflags="-d=ssa/check_bce" ./internal/graphics internal/graphics/vertex.go:83:11: Found IsSliceInBounds internal/graphics/shader.go:134:37: Found IsSliceInBounds ``` Updates #2601
This commit is contained in:
parent
d9797423e5
commit
407d7bd43f
@ -80,7 +80,7 @@ func QuadVertices(dst []float32, sx0, sy0, sx1, sy1 float32, a, b, c, d, tx, ty
|
||||
u0, v0, u1, v1 := sx0, sy0, sx1, sy1
|
||||
|
||||
// This function is very performance-sensitive and implement in a very dumb way.
|
||||
_ = dst[:4*VertexFloatCount]
|
||||
dst = dst[:4*VertexFloatCount]
|
||||
|
||||
dst[0] = adjustDestinationPixel(tx)
|
||||
dst[1] = adjustDestinationPixel(ty)
|
||||
|
Loading…
Reference in New Issue
Block a user