Commit Graph

93 Commits

Author SHA1 Message Date
Hajime Hoshi
af9bd6a282 all: specify src-regions correctly
This parameter was not important and actually not used with usual
shaders. However, now this information will be important for the
restorable package optimization later.

There was a performance issue that was caused by srcRegions, but
now this should not happen thanks to FilterUniformVariables.

Updates #1293
2024-09-08 22:24:15 +09:00
Hajime Hoshi
30a2817ab5 internal/restorable: add Hint to optimize drawImageHistoryItem size 2024-09-08 12:24:20 +09:00
Hajime Hoshi
81c75e1b0a Revert "internal/atlas: refactoring: remove ImageTypeVolatile"
This reverts commit def82fd5d3.

Updates #3083
2024-09-07 16:54:20 +09:00
Hajime Hoshi
b6ab7a10c1 internal/graphics: unify QuadVertices
This is a preparation for adding members to Vertex.

Updates #2640
2024-08-12 00:29:24 +09:00
Hajime Hoshi
def82fd5d3 internal/atlas: refactoring: remove ImageTypeVolatile
ImageTypeVolatile was meaningful when Ebitengine had `restorable`
package, but now this doesn't make sense.
2024-06-30 18:50:02 +09:00
Bertrand Jung
22fd1f107e
internal/graphics: renamed shader image count to specify src (#3012)
This just specifies that the constant refers to the number of source images passed to a shader.

This makes a distinction with the number of dst images, that could potentially be more than 1 in the future.
2024-06-10 02:02:47 +09:00
Hajime Hoshi
e5d10c47e7 internal/graphicsdriver: reland: rename FillRule constants
Updates #3006
2024-06-08 12:16:20 +09:00
Hajime Hoshi
6ac1270cb0 Revert "internal/graphicsdriver: rename FillRule constants"
This reverts commit ab4a3af1b5.

Reason: compile error on Windows
2024-06-08 12:10:27 +09:00
Hajime Hoshi
ab4a3af1b5 internal/graphicsdriver: rename FillRule constants
Updates #3006
2024-06-08 11:54:46 +09:00
Hajime Hoshi
1ebfa8b911 internal/ui: refactoring: remove unused code 2024-05-04 00:26:40 +09:00
Hajime Hoshi
7b3eae3dcb internal/ui: reland: move dotsBuffer from internal/ui.Image to internal/buffered.Image
This is a reland of fb426cd0dd.

This is a refactoring as 'caching' things should be in internal/buffered,
but also this is a performance optimization to make pixels and dotsBuffer
work well together.
2024-01-16 12:45:43 +09:00
Hajime Hoshi
b2759b66f9 Revert "internal/ui: move dotsBuffer from internal/ui.Image to internal/buffered.Image"
This reverts commit fb426cd0dd.

Reason: processtest (TestPrograms/issue2089) failed (flaky)
2024-01-16 02:56:24 +09:00
Hajime Hoshi
fb426cd0dd internal/ui: move dotsBuffer from internal/ui.Image to internal/buffered.Image
This is a refactoring as 'caching' things should be in internal/buffered,
but also this is a performance optimization to make pixels and dotsBuffer
work well together.
2024-01-16 02:08:41 +09:00
bsski
b8df1217c3
all: fix typos (#2864) 2023-12-17 22:42:34 +09:00
Hajime Hoshi
3b1684978b internal/ui: typo 2023-12-06 23:00:58 +09:00
Hajime Hoshi
4e93efa5ac internal/graphicsdriver: reland: add FillRule and replace boolean values with this
Updates #2782
2023-11-04 19:09:50 +09:00
Hajime Hoshi
f695df5924 Revert "internal/graphicsdriver: add FillRule and replace boolean values with this"
This reverts commit 38cf964a3b.

Reason: build failure on Windows
2023-11-04 19:02:40 +09:00
Hajime Hoshi
38cf964a3b internal/graphicsdriver: add FillRule and replace boolean values with this
Updates #2782
2023-11-04 18:57:31 +09:00
Hajime Hoshi
1f95c98969 internal/graphics: reland: change the definition of MaxVerticesCount
Updates #2612
2023-11-04 16:02:22 +09:00
Hajime Hoshi
3a632be0c7 Revert "internal/graphics: change the definition of MaxVerticesCount"
This reverts commit 3047ad202a.

Reason: Failed to build for 32bit architectures

Updates #2612
2023-11-04 15:10:31 +09:00
Hajime Hoshi
3047ad202a internal/graphics: change the definition of MaxVerticesCount
Updates #2612
2023-11-04 14:38:34 +09:00
Hajime Hoshi
f2544a1bd9 internal/graphicsdriver: use []uint32 instead of []uint16 for indices
Updates #2612
2023-11-04 04:39:17 +09:00
Hajime Hoshi
c01ceeaa6a ebiten: replace (*Image).Dispose with Deallocate
Closes #2808
2023-11-03 17:45:39 +09:00
Hajime Hoshi
457f6bb964 Revert "internal/ui: bug fix: panic at ReadPixels before running"
This reverts commit 2f6df3d4d6.

Reason: regression by calling (*ebiten.Image).At from a different goroutine

Updates #2820
2023-10-27 14:29:41 +09:00
Hajime Hoshi
2f6df3d4d6 internal/ui: bug fix: panic at ReadPixels before running
Closes #2820
2023-10-27 12:18:34 +09:00
Hajime Hoshi
c2ad36bdce internal/ui: use BlendSourceOver at Fill when possible
Closes #2817
2023-10-21 01:24:49 +09:00
Hajime Hoshi
83a4133577 internal/ui: refactoring: remove globalState 2023-10-15 16:51:16 +09:00
Hajime Hoshi
27fd10595b internal/ui: refactoring: reduce global functions and prefer Get() 2023-10-15 03:40:48 +09:00
Hajime Hoshi
4ca3fa5e57
internal/graphicsdriver: replace Region with image.Rectangle (#2791)
Closes #2790
2023-09-28 14:29:55 +09:00
Hajime Hoshi
534370f7b1 internal/graphics: enable to specify regions for each source image
This is a preparation to specify different sizes of source images.

Updates #1870
2023-08-27 21:15:01 +09:00
divVerent
b96aea70f1
internal/ui: compute antialias region size correctly. (#2681)
Closes #2679
2023-06-24 02:25:19 +09:00
Hajime Hoshi
d2c991b774 all: refactoring: use image.Rectangle 2023-04-28 01:03:38 +09:00
Hajime Hoshi
31273c875f internal/graphics: rename constants 2023-03-23 20:48:39 +09:00
Hajime Hoshi
c7214ef6fb internal/ui: use MaxVertexCount instead of IndicesCount
Updates #2460
2023-03-23 19:44:00 +09:00
Hajime Hoshi
051b0c7238 internal/ui: bug fix: a big-offscreen size could be 0
Closes #2589
2023-03-03 22:34:43 +09:00
Hajime Hoshi
ea7d007df9 internal/ui: bug fix: dstRegion should not exceed the image region
Closes #2577
2023-02-21 14:15:39 +09:00
Hajime Hoshi
d91b8cae88 internal/ui: reland: refactoring: improve anti-alias logic
* Remove the image extension. The image is always flushed when necessary.
* Use a small offscreen image whichever the blend is.

Updates #2399
2023-02-19 23:49:32 +09:00
Hajime Hoshi
3aa8448511 Revert "internal/ui: refactoring: improve anti-alias logic"
This reverts commit 41f8295611.

Reason: test failures: https://github.com/hajimehoshi/ebiten/actions/runs/4216421788/jobs/7318236488
2023-02-19 22:46:37 +09:00
Hajime Hoshi
41f8295611 internal/ui: refactoring: improve anti-alias logic
* Remove the image extension. The image is always flushed when necessary.
* Use a small offscreen image whichever the blend is.

Closes #2399
2023-02-19 22:14:23 +09:00
Hajime Hoshi
961c34efb5 internal/ui: use a small buffer image for anti-alias
Closes #2399
2023-02-19 17:35:43 +09:00
Hajime Hoshi
8479fee606 internal/ui: refactoring 2023-02-18 18:23:57 +09:00
Hajime Hoshi
56597800dd internal/ui: refactoring: add bigOffscreenImage
Updates #2399
2023-02-18 02:32:41 +09:00
Hajime Hoshi
38f802cb40 internal/ui: simplify the logic of skipping rendering 2022-12-20 11:34:47 +09:00
Hajime Hoshi
0a6813c17f internal/graphics: use flatten []float32 slice instead of [][]float32
Closes #2479
2022-12-03 20:23:58 +09:00
Hajime Hoshi
61f1d8b69f internal/graphics: remove the common vertices backend
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
2022-12-03 01:02:23 +09:00
Hajime Hoshi
419bb4c1e9 all: use uint32 instead of float32 for uniform values
This is a preparation for other types of uniform values.

Updates #2305
2022-11-12 20:28:07 +09:00
Hajime Hoshi
066029539e internal/ui: clean-up code
A callback is preferred to a dirty flag.

Updates #2341
2022-10-28 19:07:37 +09:00
Hajime Hoshi
b019a3723a internal/ui: optimize GPU usages when the screen doesn't have to be updated
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
2022-10-28 18:51:06 +09:00
Hajime Hoshi
422de70d59 internal/ui: bug fix: screenshot didn't include antialias renderings 2022-10-22 14:19:24 +09:00
Hajime Hoshi
f04e391cb4 all: rename emptyImage -> whiteImage 2022-10-21 15:26:56 +09:00