Commit Graph

5123 Commits

Author SHA1 Message Date
Hajime Hoshi
beac278c59 internal/grahics, internal/shadeir: use the term Dword instead of Uint32
This change also renames DWord to Dword.
2024-12-07 22:26:09 +09:00
Hajime Hoshi
e4efbfd1f1 internal/graphicsdriver/directx: refactoring 2024-11-26 12:56:54 +09:00
Hajime Hoshi
800be4f772 ebiten: add test for matrix indices 2024-11-26 12:24:39 +09:00
Hajime Hoshi
1ea14d5076 internal/graphicsdriver/metal, internal/shaderir/msl: use one integrated struct for uniforms
Closes #3164
2024-11-26 00:40:58 +09:00
Hajime Hoshi
81bb5044ea internal/shaderir: revert the refactoring to generalize the memory layout logic
Unfortunately, the memory layout was not so universal. For example,
the memory layout for mat2 is different between Metal and DirectX.
2024-11-24 23:57:30 +09:00
Hajime Hoshi
b24bd93ae5 internal/shaderir: typo 2024-11-24 23:16:04 +09:00
Hajime Hoshi
4aad9d37e9 internal/shaderir: cache offset calculations for HLSL 2024-11-24 21:59:45 +09:00
Hajime Hoshi
c5d664ccf7 internal/shaderir/hlsl: refactoring 2024-11-24 18:47:49 +09:00
Hajime Hoshi
fab511e96b internal/graphicsdriver/playstation5: bug fix: compile error 2024-11-17 19:13:46 +09:00
Hajime Hoshi
2d1e286e87 internal/graphicsdriver/playstation5: avoid a Go pointer to a Go pointer 2024-11-17 18:48:11 +09:00
Hajime Hoshi
960189b051 internal/shaderlister: add SourceHash 2024-11-17 15:44:51 +09:00
Hajime Hoshi
53687aafb0 internal/shaderlister: reland: compile shaders
Updates #3157
2024-11-16 19:22:59 +09:00
Hajime Hoshi
ab954c9c6e Revert "internal/shaderlister: compile shaders"
This reverts commit 848e30e0e7.

Reason: test failures
2024-11-16 19:14:02 +09:00
Hajime Hoshi
848e30e0e7 internal/shaderlister: compile shaders
Updates #3157
2024-11-16 19:11:44 +09:00
Hajime Hoshi
de1ef0bec8 internal/builtinshader: refactoring 2024-11-16 15:29:52 +09:00
Hajime Hoshi
d021209d84 internal/builtinshader: add shader constants for shaderlister
Updates #3157
2024-11-16 15:23:49 +09:00
Hajime Hoshi
864f826b3c internal/shaderlister: bug fix: skip tests when Go is not found (e.g. Wasm)
Updates #3157
2024-11-10 23:34:51 +09:00
Hajime Hoshi
75d7a26fcd internal/shaderlister: output [] instead of null when no shaders are found
Updates #3157
2024-11-10 23:27:24 +09:00
Hajime Hoshi
9b849819f3 internal/shaderlister: refactoring: do not use github.com/hajimehoshi/ebiten/v2 command 2024-11-10 23:03:22 +09:00
Hajime Hoshi
99bbe7138c internal: add shaderlister
This adds a new compiler directive `//ebitengine:shader` indicating
a shader source. A new tool internal/shaderlister can iterates all
the shader strings with the directive. The tool might be exposed
in the future.

Updates #3157
2024-11-10 22:21:42 +09:00
Hajime Hoshi
03cbfaca42 internal/vettools: return non-nil value
When executing internal/vettools directly by `go run`, this caused
an error since the return type must match with ResultType.
2024-11-09 22:46:01 +09:00
Hajime Hoshi
b6d539d8e8 internal/graphicsdriver/opengl: refactoring 2024-11-07 13:25:26 +09:00
Hajime Hoshi
4be626f707 internal/graphicsdriver/opengl: bug fix: use GLX when possible for ES
Use GLX when possible. EGL with an X window might not work well on
Wayland unfortunately.

Closes #3152
2024-11-07 02:07:13 +09:00
Hajime Hoshi
1014e45365 internal/graphicsdriver/playstation5: bug fix: compilation error 2024-11-03 19:47:18 +09:00
Hajime Hoshi
72e2941e95 internal/graphicsdriver/playstation5: update NewShader 2024-11-03 19:09:38 +09:00
Hajime Hoshi
c13e4fea7d internal/graphicsdriver/playstation5: update 2024-11-02 22:18:23 +09:00
Hajime Hoshi
2fab556dd9 internal/affine: refactoring: remove unused types 2024-10-27 22:44:58 +09:00
Hajime Hoshi
dc41960d3b internal/mipmap: refactoring: add a fast path 2024-10-27 01:06:36 +09:00
Hajime Hoshi
00fade9dcf internal/atlas: reduce the access to (*restorable.Shader).Unit 2024-10-27 00:46:05 +09:00
Hajime Hoshi
6cf235daef internal/graphicscommand: refactoring 2024-10-26 23:07:03 +09:00
Hajime Hoshi
e6b8ebe8a2 internal/gamepaddb: bug fix: typo
Closes #3148
2024-10-26 19:05:51 +09:00
Hajime Hoshi
c7880a5ad6 internal/atlas: reduce for-loops 2024-10-26 16:02:25 +09:00
Hajime Hoshi
ecc42d4042 internal/graphicscommand: move the const check outside of the function
old.txt: 1fe988eabf
new.txt: this commit

```
benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/hajimehoshi/ebiten/v2/internal/graphicscommand
cpu: Apple M3 Pro
                            │   old.txt   │              new.txt               │
                            │   sec/op    │   sec/op     vs base               │
PrependPreservedUniforms-12   19.79n ± 4%   18.84n ± 2%  -4.80% (p=0.001 n=10)
```

Updates #3144
2024-10-26 13:03:37 +09:00
Hajime Hoshi
1fe988eabf internal/graphicscommand: improve performance of prependPreservedUniforms
```
% benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/hajimehoshi/ebiten/v2/internal/graphicscommand
cpu: Apple M3 Pro
                            │   old.txt   │               new.txt               │
                            │   sec/op    │   sec/op     vs base                │
PrependPreservedUniforms-12   23.07n ± 2%   19.96n ± 0%  -13.48% (p=0.000 n=10)
```

Updates #3144
2024-10-26 01:18:06 +09:00
Hajime Hoshi
9f5f53c041 internal/graphicscommand: add BenchPrependPreservedUniforms
Updates #3144
2024-10-26 01:15:12 +09:00
Hajime Hoshi
d334db8291 internal/restorable: performance optimization 2024-10-25 19:30:38 +09:00
Hajime Hoshi
f6cd2beacf internal/buildinshader: refactoring 2024-10-24 12:16:05 +09:00
Hajime Hoshi
0a73cbfce4 internal/builtinshader: refactoring 2024-10-22 14:29:46 +09:00
Hajime Hoshi
74f812dd33 internal/shader: bug fix: xor-assignment operator didn't work correctly
Closes #3140
2024-10-21 14:54:07 +09:00
TotallyGamerJet
6452cbc895
internal/cocoa: bring back NSInvocation for CopyFromTexture (#3136)
This is a partial revert of c3ea539 but keeps the change for removal of NSInvocation in SetScissorRect, GetBytes,
and ReplaceRegion.

Closes #3135
2024-10-19 23:59:45 +09:00
Hajime Hoshi
0af6497017 internal/ui: update gamepads for PS5 2024-10-19 22:43:14 +09:00
Hajime Hoshi
c3ea539cdb internal/cocoa: remove NSInvocation
Closes #2950
2024-10-19 13:32:14 +09:00
Gabriel Ochsenhofer
2ad0e9a9db
internal/graphicscommand: add a debug.IsDebug check before splitting strings (#3134)
Since `debug.IsDebug` is a constant, by putting the `strings.Cut` calls inside the check this makes the
`(*commandqueue).flush` method faster when Ebitengine is compiled without the debug build tag.

Without the if `debug.IsDebug` check, unnecessary allocations occur (since the logger is a noop logger when debug is
disabled).
2024-10-18 22:46:28 +09:00
Hajime Hoshi
aae3e739f8 internal/debug: use go/build's Context to get the source directory 2024-10-18 15:36:25 +09:00
Hajime Hoshi
0ce1f2292e internal/debug: bug fix: do not panic when go-list fails 2024-10-18 15:28:42 +09:00
TotallyGamerJet
5dee21dc7d
internal/cocoa, internal/graphicsdriver/metal/*: minimize allocations (#3133)
Cache the result of objc.RegisterName at program startup. Use NSInvocation less
to avoid multiple C calls.
2024-10-18 11:44:37 +09:00
Hajime Hoshi
71ae311355 internal/debug: better info for first callers 2024-10-16 11:16:24 +09:00
Hajime Hoshi
74765c995e internal/debug: bug fix: panic when Go command is not found with -tags=ebitenginedebug 2024-10-15 21:29:15 +09:00
Hajime Hoshi
9de408a25c internal/graphicscommand: better calculation for callers 2024-10-15 21:13:17 +09:00
Hajime Hoshi
7f87ecaddc internal/graphicscommand: better debug info for blending 2024-10-15 18:26:27 +09:00