Commit Graph

924 Commits

Author SHA1 Message Date
Hajime Hoshi
297efea68b internal/graphicsdriver/opengl/gl: use C version for Android
Unfortunately PureGo's dlopen didn't work on some Android devices.
Use the Cgo version instead in the same way as v2.7.

Closes #3052
2024-08-01 11:52:07 +09:00
Hajime Hoshi
3106f98b52 internal/graphicsdriver/opengl/gl: add more error messages to load libraries 2024-07-31 21:35:24 +09:00
Hajime Hoshi
ef5ac4175d all: use bufio.Reader to improve reading speed 2024-07-29 02:28:37 +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
Bertrand Jung
46d171c3c5
all: open up for more destinations images (#3013)
Updates #2930
2024-07-09 02:05:55 +09:00
Hajime Hoshi
073d022c2e internal/graphicsdriver/opengl: remove IsFramebuffer and IsRenderbuffer
These function return true in most cases, and when these return false,
the situation is pretty bad and recovering the situation would not be
possible.

IsFramebuffer and IsRenderbuffer cause round trips and affect performance.
Let's remove them.
2024-07-06 19:15:01 +09:00
Hajime Hoshi
4997e7e254 internal/graphicsdriver/opengl: lazy error check of shaders
See https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#dont_check_shader_compile_status_unless_linking_fails
2024-07-04 21:47:52 +09:00
Hajime Hoshi
c29d4b24bb internal/graphicsdriver/opengl: skip checkFramebufferStatus on browsers 2024-07-03 20:34:44 +09:00
Hajime Hoshi
a6d7cadab7 internal/graphicsdriver/playstation5: change struct member names 2024-06-17 03:04:18 +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
4818768965 shaderprecomp: remove ShaderSourceID
`ShaderSourceID` was confusing as there was no guarantee the same ID is
used for the same source if Ebitengine versions are different.

`ShaderSource` should be kept as the built-in shader contents should not
be exposed.

Updates #2861
Closes #2999
2024-05-27 00:01:05 +09:00
Hajime Hoshi
83ae577c80 Revert "shaderprecomp: remove ShaderSource and ShaderSourceID"
This reverts commit 8be3bb41d5.

Reason: removing `ShaderSource` unexpected exposes the source.

Updates #2999
2024-05-26 22:45:12 +09:00
Hajime Hoshi
8be3bb41d5 shaderprecomp: remove ShaderSource and ShaderSourceID
This change simplifies the APIs to avoid some confusions around IDs.

Updates #2861
Closes #2999
2024-05-26 22:42:52 +09:00
Hajime Hoshi
b0a4b6ebbf internal/graphicsdriver/playstation5: update the copyright year 2024-05-19 23:01:47 +09:00
Hajime Hoshi
657e04d3d1 internal/graphicsdriver/playstation5: separate the shader part 2024-05-19 18:05:16 +09:00
Hajime Hoshi
5bb060b1e9 shaderprecomp: add pssl 2024-05-12 15:07:38 +09:00
Hajime Hoshi
b3ad97b22b internal/graphicsdriver/metal/mtl: add comments 2024-05-06 22:07:16 +09:00
Hajime Hoshi
f0ca3f1870 internal/graphicsdriver/metal/mtl: follow ObjC convention
Closes #2981
2024-05-06 21:51:57 +09:00
Hajime Hoshi
2261cf76de internal/graphicsdriver/metal/ca: follow ObjC convention
Updates #2981
2024-05-06 19:36:17 +09:00
Hajime Hoshi
10d9660125 shaderprecomp: implement for Windows
Closes #2861
2024-05-06 16:03:57 +09:00
Hajime Hoshi
5d4a68b0ea internal/shaderir/hlsl: refactoring: separate calculation uniform offsets 2024-05-05 20:47:35 +09:00
Hajime Hoshi
a41af4528b internal/graphicsdriver/directx: refactoring 2024-05-05 18:58:13 +09:00
Hajime Hoshi
caab1ee29f internal/graphicsdriver/metal: refactoring 2024-05-05 17:18:06 +09:00
Hajime Hoshi
c46f62e184 all: add a new package shaderprecomp
The current implementation is only for macOS so far.

Updates #2861
2024-05-05 03:51:04 +09:00
Hajime Hoshi
ca9a80600d internal/graphicsdriver/metal: release MTLLibrary 2024-05-04 19:26:12 +09:00
Hajime Hoshi
59fb259181 internal/graphicsdriver/gl: use PureGo for Linux and UNIX
Updates #2284
2024-04-29 21:25:15 +09:00
Hajime Hoshi
4647e9de53 internal/glfw, internal/gamepad: update GLFW to v3.3.9
Updates #2960
2024-04-14 01:14:22 +09:00
Hajime Hoshi
3cf3b27729 internal/graphicsdriver/opengl: refactoring: rename variables
A framebuffer's width and height are unclear. Rename them to
viewportWidth and viewportHeight.
2024-04-10 23:38:25 +09:00
Hajime Hoshi
9c070eb2f3 Revert "internal/graphicsdriver/gl: use PureGo for Linux and UNIX"
This reverts commit 5701206229.

Reason: error on Android:

```
/Users/runner/go/pkg/mod/github.com/ebitengine/purego@v0.8.0-alpha.0.20240404024320-d0aedd0f4393/func.go:301:4: too few values in struct literal of type syscall15Args
```

https://github.com/hajimehoshi/ebiten/actions/runs/8582651053/job/23521003819
2024-04-07 03:00:13 +09:00
Hajime Hoshi
5701206229 internal/graphicsdriver/gl: use PureGo for Linux and UNIX
Updates #2284
2024-04-07 02:08:40 +09:00
Hajime Hoshi
caecd81f4e Revert "internal/graphicsdriver/directx: add 'tearing' for EBITENGINE_DIRECTX"
This reverts commit b6252a41f2.

Reason: We need more investigation about tearing and vsync=off

Updates #2858
2024-03-30 20:08:06 +09:00
Hajime Hoshi
b6252a41f2 internal/graphicsdriver/directx: add 'tearing' for EBITENGINE_DIRECTX
Now tearing happens only when 'tearing' is specified and vsync is off.

Closes #2858
2024-03-23 17:53:13 +09:00
Hajime Hoshi
732eedf2e0 all: use github.com/ebitengine/gomobile instead of golang.org/x/mobile
Closes #2748
Closes #2899
2024-02-24 22:07:27 +09:00
Hajime Hoshi
770fcff4c2 internal/graphicsdriver/directx: bug fix: Go 1.22 + 32bit Windows + DirectX 12 didn't work well
Apparently, a pseudo padding was needed for D3D12_RESOURCE_DESC,
but this is still mysterious.

This change also add Go 1.22 to the GitHub Actions.

Closes #2867
2024-01-27 18:06:53 +09:00
Hajime Hoshi
8551cd350f internal/ui: bug fix: need to sleep when swapping buffers is skipped
Closes #2890
2024-01-24 12:20:30 +09:00
Hajime Hoshi
006f14ac19 internal/graphicsdriver/playstation5: bug fix: link error 2024-01-22 00:14:00 +09:00
Hajime Hoshi
52e0f10ff7 internal/graphicsdriver/playstation5: bug fix: compile error 2024-01-22 00:05:02 +09:00
Hajime Hoshi
f0509096f8 internal/graphicsdriver/playstation5: add ebitengine_IsErrorNil 2024-01-21 23:54:02 +09:00
Hajime Hoshi
e0ccd013ac internal/graphicsdriver/directx: bug fix: depth should be passed by math.Float32bits
As depth was always 0, there was not an actual problem.
2024-01-21 21:43:09 +09:00
Hajime Hoshi
5887142da7 internal/grpahicsdriver/metal/mtl: use 3 drawings for fullscreen
Hajime found that renderings were delayed with 2 drawing in fullscreen
though FPS might be lowered. This is mysterious but there is no other
good solution.

Updates #2883
2024-01-19 18:29:47 +09:00
Hajime Hoshi
e39c50c296 internal/graphicsdriver/metal: add comments
Updates #2880
Updates #2883
2024-01-17 20:51:32 +09:00
Hajime Hoshi
055db234a1 internal/graphicsdriver/metal: bug fix: use 2 as a drawable count for Arm Mac
Closes #2883
2024-01-17 18:57:50 +09:00
Hajime Hoshi
a0cb0d0568 internal/graphicsdriver/playstation5: use message to detect errors 2024-01-14 22:18:12 +09:00
Hajime Hoshi
00e67b8419 internal/graphicsdriver/playstation5: improve error handlings
Updates #2799
2024-01-14 00:42:13 +09:00
Hajime Hoshi
5a36b4bb48 internal/graphicsdriver/opengl/gl: remove IsTexture
Updates #805
2024-01-09 02:35:30 +09:00
Hajime Hoshi
48e3c766f7 internal/graphicsdriver: remove Image.IsInvalidated
Updates #805
2024-01-09 00:30:21 +09:00
Hajime Hoshi
a19f079da8 internal/graphicsdriver/playstation5: remove NeedsRestoring 2024-01-09 00:26:01 +09:00