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
This is basically a revert for 4d5b608d0c.
This caused a crash on Windows.
Even after this fix, the browser tests seem no longer flaky, but
I am not 100% sure.
Updates #2391Closes#2423
This change skips rendering when 1) the screen is not cleared every frame
(`SetScreenClearedEveryFrame(false)`) and 2) Draw doesn't draw anything
onto the screen. The GPU usages decreased on some machines (e.g. GPU usage
was 10% with an empty Ebitengine project and became 2-3 % on a Windows
machine).
Updates #2341
(*Image).WritePixels doens't send a command to the queue immediately
but caches commands internally. However, the package atlas assumed
that pixel data was sent to the cache every end of a frame. Then, byte
slices for pixels were corrupted.
This change fixes the issue by resolving all the images when flushing
commands.
Closes#2390
Before this change, presenting happened when the rendering destination
was the final screen. Now this assumption is wrong as the final screen
might be used in the middle of the commands due to DrawFinalScreen.
Instead, this change adds a new argument `present` to FlushCommands to
present the screen explicitly at the end of the frame.
Closes#2386
Now Kage shaders are always used.
The situtation is different from when we fixed for #1355, so we removed
the fast path for #1335. We have to re-check the current performance.
Updates #1355
This function was not called actually, so this is not a real problem.
However, this could be a potential problem for a future GLES driver (#292).
Updates #292Closes#2321
This reverts these commits
* 3259ef3daf
* 7c55065490
* 5bb70f485e
Reason: iOS crash. Probably we have to prepare a special rendering
pipeline for the final screen.
Closes#2278