A managed byte slice from the new byte slice pool has a function
to release and put it back to the pool explicitly, and this doesn't
rely on GCs.
Updates #1681Closes#2804
The old byte pool depnded on lifetimes of command queues, and this
was tricky.
The new byte pool uses runtime.SetFinalizer so this should be much
easier to use.
Updates #1681
Bytes from a pool in a command queue is now pretty hard to use correctly
as the lifetime of a queue is not clear.
Remove the byte pools once. Let's reconsider pool usages later.
This change also removes imagesWithBuffers as this is no longer needed.
imagesWithBuffers was necessary to ensure all the bytes from the pool
of the command queue was used before the queue flushes the commands,
as the command queue cleared the pool after flushing. The lifetimes
were pretty ticky.
This is a reland of 2c9f5d9dad.
As the name is `usedAsDestination`, this should be updated whenever
the image is used as a rendering destination.
Confirmed that this change didn't cause a performance regression
like #2586.
Updates #2586
Updates #2676
As the name is `usedAsDestination`, this should be updated whenever
the image is used as a rendering destination.
Confirmed that this change didn't cause a performance regression
like #2586.
Updates #2586
Updates #2676
An image has a counter to count how many times an image is used.
Before this change, the counter was updated only when an image was moved
from a source backend to a destination backend. This seemed not enough,
and an image was likely moved to a source backend more often than
necessary (#2676).
However, there was also an issue that the counter was updated too
aggressively and the image was unlikely moved from a destination to
a source image (#2586).
In order to resolve this dilemma, let's adopt an intermediate way:
count up the counter at most once per frame.
Updates #2586
Updates #2676
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