Commit Graph

374 Commits

Author SHA1 Message Date
Hajime Hoshi
1f03971fa9 internal/debug: reland: rename functions 2024-08-07 23:48:35 +09:00
Hajime Hoshi
fab9482e0e Revert "internal/debug: rename functions"
This reverts commit 74722298a2.

Reason: This included an unexpected change in internal/gamepad
2024-08-07 23:47:51 +09:00
Hajime Hoshi
74722298a2 internal/debug: rename functions 2024-08-07 23:42:36 +09:00
Hajime Hoshi
1804d56777 Revert "all: open up for more destinations images (#3013)"
This reverts commit 46d171c3c5.

Reason: MRT is now suspended. Let's revisit this when we work on MRT again.
2024-07-16 22:43:49 +09:00
Hajime Hoshi
9bc5ed3847 internal/graphicscommand: bug fix: missing file
Updates #3036
2024-07-12 11:30:36 +09:00
Hajime Hoshi
7b46df44ee internal/graphicscommand: bug fix: buffered write pixel args might never be released
Closes #3036
2024-07-12 11:25:50 +09:00
Bertrand Jung
46d171c3c5
all: open up for more destinations images (#3013)
Updates #2930
2024-07-09 02:05:55 +09:00
Hajime Hoshi
346aaf071e internal/graphicscommand: add screen info to log 2024-07-04 02:01:56 +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
f34932151d all: use atomic.Bool instead of atomic.Store/LoadUint32
Updates #2422
2024-04-29 21:16:01 +09:00
Hajime Hoshi
bc9e9d8562 ebiten: move the builtin shader to internal/builtinshader
Updates #2861
2024-04-20 21:23:37 +09:00
Pedro Tiple
6fafe734da
internal/graphicscommand: refactoring: remove a hard-coded part for ShaderImageCount (#2895)
This change allows increasing ShaderImageCount without breaking the image display.
Simply made the uniform processing dynamic based on ShaderImageCount.
2024-01-26 13:03:04 +09:00
Hajime Hoshi
48e3c766f7 internal/graphicsdriver: remove Image.IsInvalidated
Updates #805
2024-01-09 00:30:21 +09:00
Hajime Hoshi
2da56c00c8 internal/ui: remove renderThread
Updates #2714
2024-01-02 17:14:38 +09:00
Hajime Hoshi
338b8957e8 internal/graphicscommand: add Terminate
This change reduces a render thread usage in internal/ui.

Updates #2714
2023-12-27 02:28:55 +09:00
Hajime Hoshi
4895ae7f93 internal/graphicsdriver/opengl: refactoring: move some functions from internal/ui
Updates #2714
2023-12-23 22:30:13 +09:00
bsski
b8df1217c3
all: fix typos (#2864) 2023-12-17 22:42:34 +09:00
Hajime Hoshi
d7ebc19d04 internal/ui: refactoring: reduce usages of renderThread
Updates #2714
2023-12-17 16:21:07 +09:00
Hajime Hoshi
d91455c0a7 internal/graphicscommand: add Shader.id 2023-12-01 21:31:50 +09:00
Hajime Hoshi
3ca6184294 ebiten: add a new FillRule: NonZero
Closes #2782
2023-11-06 12:11:38 +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
3fa8e6ac52 internal/graphics: refactoring: move some constants to internal/graphicscommand 2023-11-04 16:33:30 +09:00
Hajime Hoshi
d862a75fb3 internal/graphics: rename constants
Closes #2828
2023-11-04 16:06:35 +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
6339872da8 internal/graphicscommand: disable asynchronous rendering when vsync is on
Asynchronouse rendering was introduced at #2664, but apparently this
caused a delay between a game's update and its rendering.

Disable this when vsync is on. When vsync is off, we should not have
to care the delay since new renderings keep to come. Rather,
asynchronous renderings improves FPS.

Updates #2664
Updates #2822
2023-10-28 14:59:25 +09:00
Hajime Hoshi
27fd10595b internal/ui: refactoring: reduce global functions and prefer Get() 2023-10-15 03:40:48 +09:00
Hajime Hoshi
f269b61903 internal/atlas: introduce a managed byte slice pool
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 #1681
Closes #2804
2023-10-09 20:32:32 +09:00
Hajime Hoshi
6e5361c328 internal/restorable: use clearImage to avoid allocations
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.
2023-10-09 00:42:58 +09:00
Hajime Hoshi
e768e8ad40 internal/graphicscommand: refactoring: add commandqueue.go 2023-10-08 19:54:28 +09:00
Hajime Hoshi
9ed3c89594 internal/graphicscommand: remove an image from imageWithBuffers whenever possible 2023-10-08 19:43:58 +09:00
Hajime Hoshi
810b62f83e internal/graphicscommand: introduce commandQueuePool and commandQueueManager
This removes the restriction of the number of command queues.

Updates #1704
2023-10-08 19:23:57 +09:00
Hajime Hoshi
d2dd62b6db internal/graphicscommand: remove unnecessary references to drawTrianglesCommand 2023-10-08 17:18:16 +09:00
Hajime Hoshi
fd1083808c internal/graphicscommand: switch the queue before flushing
This is a preparation to do something (e.g. handling inputs) during
being blocked by Flush.

Updates #1704
2023-10-08 16:10:07 +09:00
Hajime Hoshi
53525342b1 internal/graphicscommand: bug fix: Flush didn't return error when sync=false 2023-10-08 04:30:14 +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
Hajime Hoshi
4116fd3eb4 internal/debug: bug fix: add SwitchLogger to dump logs for each frame correctly
Closes #2731
2023-08-26 03:38:37 +09:00
Hajime Hoshi
b29fc5672c internal/graphicscommand: use bufio to make dumping images faster 2023-08-26 00:50:45 +09:00
Hajime Hoshi
fd5e2d39c0 internal/graphics: add uniform variables for source image sizes
Updates #1870
2023-08-25 07:30:52 +09:00
Hajime Hoshi
2de64088dc internal/graphicscommand: reduce boundary checks
This can be confirmed by this command:

```
go build -gcflags="-d=ssa/check_bce" ./internal/graphicscommand/
```

Updates #2601
2023-08-21 03:15:31 +09:00
Hajime Hoshi
c00795416a internal/graphicscommand: remove a redundant boundary check
The boundary is already checked the above 'copy' call. This can be
confirmed by the result of this command.

```
go build -gcflags="-d=ssa/check_bce" ./internal/graphicscommand/
```
2023-08-20 15:45:19 +09:00
Hajime Hoshi
3b67b91bb2 internal/graphicscommand: remove redundant buffers
Now there are two command queues, uint32sBuffer doesn't have to have
two buffers.
2023-08-19 17:15:48 +09:00
Hajime Hoshi
fcec771f34 internal/graphicscommand: clear uniform variables explicitly
This change is a performance optimization.

(*uint32sBuffer).alloc doesn't clear the uniform values. Without
clearing the values explicitly, CanMergeWithDrawTrianglesCommand
might return false even though two commands can be merged.
2023-08-19 16:19:14 +09:00
Hajime Hoshi
e270dea460 internal/graphicsdriver: use []PixelsArgs for ReadPixels
Closes #2592
2023-08-17 03:06:48 +09:00
Hajime Hoshi
842c3cbfcd internal/graphicscommand: use a slice to values instead of pointers
This should reduce heap allocations.
2023-08-16 23:23:30 +09:00