Commit Graph

3936 Commits

Author SHA1 Message Date
Hajime Hoshi
4ff9a12930 internal/graphicscommand: refactoring 2022-11-12 22:26:28 +09:00
Hajime Hoshi
a406904a51 internal/graphicsdriver: refactoring 2022-11-12 21:03:54 +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
0db2318a8d internal/graphicsdriver/opengl: update comments 2022-11-12 19:31:16 +09:00
Hajime Hoshi
cee948048d internal/graphicsdriver/opengl: remove unused functions 2022-11-12 19:28:14 +09:00
Hajime Hoshi
4ae84c2232 internal/packing: bug fix: wrong logic for extending a page
Before this fix, 0-sized node could be created when extending the
page.

Updates #2327
2022-11-12 17:42:17 +09:00
Hajime Hoshi
2deceaa0af internal/graphicsdriver/directx: specify DX level 12
The DirectX initialization passed but crashed later on some old machines
supporting the feature level 11 but not 12.

This change fixes the issue by changing the required feature level from
11 to 12 so that the initialization fails and OpenGL is used as the
fallback.

Closes #2447
2022-11-12 12:25:24 +09:00
Hajime Hoshi
c72fd7ffcf internal/packing: enable non-square page size
Closes #2327
2022-11-11 23:11:05 +09:00
Hajime Hoshi
fde964312c internal/packing: reland: refactoring
This change basically relands these commits:

 * e08078d84a
 * 8fa36cc7ef

but with a fix internal/restorable not to create too many images.

Updates #2327
2022-11-11 21:55:11 +09:00
Hajime Hoshi
f593725bf9 Revert "internal/packing: refactoring"
This reverts these commits

* 8fa36cc7ef.
* e08078d84a

Reason: test failures

Updates #2327
2022-11-11 19:35:13 +09:00
Hajime Hoshi
8fa36cc7ef internal/packing: improve test
Updates #2327
2022-11-11 19:26:00 +09:00
Hajime Hoshi
e08078d84a internal/packing: refactoring
Now pages are automatically extended by Alloc.

Updates #2327
2022-11-11 19:12:23 +09:00
Hajime Hoshi
303965e1a9 all: remove unnecessary copying
Copying []byte to string should copy the data if necessary, as the
Go specification assures that strings are immutable.
2022-11-11 00:28:47 +09:00
Hajime Hoshi
097adcf8b6 internal/graphicsdriver/opengl/gl: reladn: refactoring
This is a reland of a1ad87a262
2022-11-09 21:02:31 +09:00
Hajime Hoshi
96298bb59d Revert "internal/graphicsdriver/opengl/gl: refactoring"
This reverts commit a1ad87a262.

Reason: compile error
2022-11-09 18:27:06 +09:00
Hajime Hoshi
a1ad87a262 internal/graphicsdriver/opengl/gl: refactoring 2022-11-09 16:07:30 +09:00
Hajime Hoshi
915fff96f8 all: reduce reflect usages 2022-11-09 13:24:31 +09:00
Hajime Hoshi
0d6b42fedd internal/ui: refactoring: keep screen/offscreen sizes as float64
Updates #2285
2022-11-09 01:18:41 +09:00
TotallyGamerJet
8c5f525ac2
internal/ui: use RegisterClass API (#2442)
Updates #1162

This change uses purego's new RegisterClass API to clean up the
EbitengineWindowDelegate ObjC class. Doing so makes the code
easier to read and more efficient since it directly get the origResizable
and origDelegate fields.
2022-11-07 14:31:39 +09:00
Hajime Hoshi
262ff351f4 internal/graphicsdriver/directx: bug fix: ScheduleFrameEventX might not return S_OK on Xbox One 2022-11-05 15:09:38 +09:00
Hajime Hoshi
58f95dd1e0 internal/ui: clean-up 2022-11-05 14:20:48 +09:00
Hajime Hoshi
cff99106b6 internal/ui: bug fix: fullscreening didn't work correctly on macOS 13
As of macOS 13, a retrieved collectionBehavior included
NSWindowCollectionBehaviorFullScreenNone and this prevented the window
from being fullscreen.

This change fixes this issue by removing the flag
NSWindowCollectionBehaviorFullScreenNone when necessary.

Closes #2437
2022-11-05 14:07:02 +09:00
Hajime Hoshi
a6e121613f internal/graphicsdriver/directx: bug fix: wrong SDK version for Xbox One 2022-11-05 02:31:28 +09:00
Hajime Hoshi
50021ef3e4 internal/graphicscommand: use buffers for []float32 to reduce allocations 2022-11-04 21:55:44 +09:00
Hajime Hoshi
d73e8f785d internal/graphicsdriver: render various destination regions as one command
Closes #2232
2022-11-04 20:49:44 +09:00
Hajime Hoshi
1ce29e2afa internal/graphicsdriver/directx: reduce rendering paths for even-odd rendering 2022-11-04 18:18:08 +09:00
Hajime Hoshi
0afb6fd22a internal/graphicsdriver/metal: reduce rendering paths for even-odd rendering 2022-11-04 16:17:51 +09:00
Hajime Hoshi
1839dd0b9b internal/graphicscommand: bug fix: test failures on Linux 2022-11-04 03:55:05 +09:00
Hajime Hoshi
005e87a917 internal/ui: prepare extra capacities for uniform variables 2022-11-04 03:18:49 +09:00
Hajime Hoshi
80e3baae9f internal/graphicscommand: reduce allocations of float32 slices 2022-11-04 02:34:44 +09:00
Hajime Hoshi
c4e4e55d75 internal/shaderir: cache reachable uniform variables
Updates #2232
2022-11-04 01:28:24 +09:00
Hajime Hoshi
384dee7160 internal/graphicscommand: remove unused uniform variables
This improves possibility of merging graphics commands by reducing
uniform variables.

Updates #2232
2022-11-03 22:45:17 +09:00
Hajime Hoshi
0762db3b3e internal/shaderir: refactoring 2022-11-03 18:16:54 +09:00
Hajime Hoshi
7dbb078a9e internal/shaderir: refactoring 2022-11-03 17:44:11 +09:00
Hajime Hoshi
e2c25dbc6d internal/shaderir: rename functions 2022-11-03 17:14:49 +09:00
Artem Yadelskyi
10415d417a
all: replace interface{} with any (#2430)
Closes #2429
2022-11-03 15:33:09 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00
Hajime Hoshi
8aacf067dd all: use x/sys/execabs instead of os/exec
Closes #2418
2022-11-01 23:36:57 +09:00
Hajime Hoshi
1b3696a7ff internal/graphicsdriver/opengl: fix comments 2022-10-31 12:59:27 +09:00
Hajime Hoshi
a5993f09a2 internal/graphicscommand: refactoring: add preserved uniform variables at the graphicscommand package
This is a preparation to skip setting unnecessary uniform variables
like dstRegion.

Updates #2232
2022-10-30 22:30:52 +09:00
Hajime Hoshi
690e73c11b all: replace reflect.SliceHeader with unsafe.Slice
Closes #2420
2022-10-30 12:25:30 +09:00
Hajime Hoshi
ac61126473 internal/graphicscommand: always flush buffers
After #2423 is fixed, buffers should be able to be flushed safely
anytime.

Updates #2391
Updates #2423
2022-10-30 10:51:41 +09:00
Hajime Hoshi
b096ba700a internal/graphicscommand: bug fix: clear buffers when disposing an image
Closes #2423
2022-10-30 03:38:53 +09:00
Hajime Hoshi
5eceabd172 Revert "internal/graphicscommand: bug fix: flush image buffers"
This reverts commit d6910eb9ab.

Reason: The wasm flakiness occured again

Updates #2391
Updates #2423
2022-10-30 02:32:28 +09:00
Hajime Hoshi
d6910eb9ab internal/graphicscommand: bug fix: flush image buffers
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 #2391
Closes #2423
2022-10-30 02:21:56 +09:00
Hajime Hoshi
ee595659e7 Revert "internal/gamepad: remove dependency on golang.org/x/sys/unix"
This reverts commit 046f7e52a3.

Reason: As we drop Go 1.16, we no longer have to remove this dependency.

Updates #2421
2022-10-29 23:23:13 +09:00
Hajime Hoshi
046f7e52a3 internal/gamepad: remove dependency on golang.org/x/sys/unix 2022-10-29 21:42:08 +09:00
Hajime Hoshi
ac08ebe080 internal/ui: set SwapInterval(0) when resizing the window
This mitigates flickering at least on macOS with OpenGL.

Updates #2144
2022-10-29 17:49:32 +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