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 change adds a new compiler directive 'kage:unit' to Kage. This
takes one of these two values: 'pixel' and 'texel'. The default value
is 'texel'.
With the pixel-unit mode, all the built-in functions treats pixels
instead of texels, and the texCoord argument of Fragment is in pixels.
This simplifies shader programs as programs no longer have the notion
of texels.
With the texel-unit mode, the behavior is the same as the current
behavior.
Closes#1431
This change is reland of 54e2790a06
but with a fix for WebGL. Also, this changes the logic when len(vertices)
exceeds the maximum: just remove the last part.
Updates #2460
It was actually impossible to use the common vertices backend in a
thread-safe manner, and actually this caused race conditions.
This changes fixes the issue by giving up a central backend, and
letting images have their own vertices buffer.
Closes#2473
Adjusting pixels is needed to avoid strainge rendering to avoid unexpected
rendering (#1171). However, this adjustment caused unexpected holes
especially in a thick stroke.
This change moves the logic of adjusting pixels from atlas to
graphics.QuadVertices so that adjusting works only for DrawImage and
DrawRectShader.
Updates #1171
Updates #1843
This is basically a reland of 9cb631e30f.
This change locks the vertices backend at the end-frame phase to
protect from vertices usages by other goroutines.
Updates #1546Closes#1681
QuadVertices or verticesBackend.slice reused its backend slice.
This caused a race condition. QuadVertices can be accessed from
multiple goroutines, and resetting the head and copying the data
at internal/graphicscommand might not be synced.
This change fixes this issue by basically reverting
9cb631e30f.
Closes#1546
It looks like the allocation cost is pretty high even on Wasm.
Revive the special method not only on GopherJS but also on Wasm.
examples/sprites kept 30FPS without this fix, but keeps 35FPS with
this fix, on Hajime's MacBook Pro 2020 (macOS Catalina 10.15.6).
Updates #797