Commit Graph

225 Commits

Author SHA1 Message Date
Hajime Hoshi
2a8e8d0eb6 internal/graphicsdriver/opengl: Stop using PBO
PBO was introduced to improve the performance at ReplacePixels,
but we found that PBO can degrades the performance. Also, now
multiple glTexImage2Ds are called successively like a batch, so
the situation is now different from that time when PBO was
introduced.

Let's remove PBO usages and wait and see.

Closes #1678
2021-06-24 21:20:58 +09:00
Hajime Hoshi
7f60cd41eb internal/graphicsdriver/opengl: Refactoring: Remove unused arguments from texSubImage2D 2021-06-24 12:06:28 +09:00
Hajime Hoshi
584c6524ee internal/graphicsdriver/opengl: Refactring 2021-06-13 14:19:33 +09:00
Hajime Hoshi
b54ad73a2b Add go:build comments with go1.17beta1 fmt 2021-06-11 01:11:46 +09:00
Hajime Hoshi
a627c41217 Remove support of Go 1.13 and Go 1.14
Updates #1258
Updates #1415
Updates #1462
2021-06-07 21:44:22 +09:00
Hajime Hoshi
6fe6543b4b internal/graphicsdriver/opengl: Bug fix: getBufferSubData was available only with WebGL2 2021-04-06 00:11:51 +09:00
Hajime Hoshi
bd8367588e internal/graphicsdriver/opengl: Prepare function objects by bind
Passing a Go string to the JS world is expensive. This change reduces
this cost by preparing function objects by bind.

Closes #1438
2021-04-05 23:53:21 +09:00
Hajime Hoshi
6b3c51921c internal/driver: Remove Image.Sync
Syncing is no longer needed for Metal, and additionally, OpenGL's sync
implementation was mock.

Updates #1508
2021-02-26 23:16:28 +09:00
Hajime Hoshi
969964cb46 internal/graphicsdriver/opengl/gl: Bug fix: Remove unsafe reflect usage
Closes #1495
2021-02-14 21:27:30 +09:00
Hajime Hoshi
b8694aa66a internal/graphicsdriver/opengl: Optimization 2021-01-26 00:45:17 +09:00
Hajime Hoshi
f77c514598 graphicsdriver/opengl: Refactoring 2021-01-05 02:07:30 +09:00
Hajime Hoshi
b7abde7f00 graphicsdriver/opengl: Bug fix: getBufferSubData did not work correctly on JS 2021-01-03 19:44:29 +09:00
Hajime Hoshi
7e32075abd jsutil: Avoid creating Uint8Array when copying bytes from Go to JS
Updates #1435
2020-12-16 01:50:05 +09:00
Hajime Hoshi
49b86843c3 jsutil: Avoid creating Uint8Array at TemporaryUint8Array
Updates #1435
2020-12-16 01:21:13 +09:00
Hajime Hoshi
146357c298 jsutil: Enable to specify length at Uint8ArrayToSlice 2020-12-15 01:13:15 +09:00
Hajime Hoshi
e5c1151cc5 jsutil: Avoid creating Float32Array at TemporaryFloat32Array
Updates #1435
2020-12-15 00:40:43 +09:00
Hajime Hoshi
f440e368b3 graphicsdriver/opengl: Use WebGL2 API on go2cpp 2020-12-14 02:02:45 +09:00
Hajime Hoshi
718273c2d7 ebiten: Add a new shader function imageDstRegionOnTexture
Updates #1428
2020-12-09 11:36:29 +09:00
Hajime Hoshi
66d12722ae graphicsdriver/opengl: Remove comments 2020-12-06 03:24:08 +09:00
Hajime Hoshi
2c31156a34 graphicsdriver/opengl: Reduce allocations of Float32Array on go2cpp
Updates #1426
2020-12-06 03:23:09 +09:00
Hajime Hoshi
d4a2433643 Revert "graphicsdriver/opengl: Reduce creation of Float32Array"
This reverts commit 3c28bcf3c4.

Reason: Tests failed: https://github.com/hajimehoshi/ebiten/runs/1496602911
2020-12-04 12:10:15 +09:00
Hajime Hoshi
3c28bcf3c4 graphicsdriver/opengl: Reduce creation of Float32Array
Updates #1426
2020-12-02 22:58:36 +09:00
Hajime Hoshi
44e2455c65 graphicsdriver/opengl: Avoid unnecessary creation of Uint16Array/Float32Array
Updates #1426
2020-12-02 20:40:28 +09:00
Hajime Hoshi
5897e1ab7c Implement some preparation code for go2cpp
Updates #744
2020-11-30 23:18:42 +09:00
Hajime Hoshi
912e13071f graphicsdriver/opengl: Refactoring 2020-11-29 23:04:00 +09:00
Hajime Hoshi
526a92256b graphicsdriver/opengl: Refactoring: Remove shaderType 2020-11-21 23:33:25 +09:00
Hajime Hoshi
8dba7b7722 graphicsdriver/opengl: Refactoring: Remove dataType 2020-11-21 23:14:43 +09:00
Hajime Hoshi
c9060d2fa8 graphicsdriver/opengl: Remove bufferType 2020-11-21 23:07:11 +09:00
Hajime Hoshi
9c014a281a graphicsdriver/opengl: Refactoring 2020-11-21 23:00:57 +09:00
Hajime Hoshi
859d247093 graphicsdriver/opengl: Refactoring 2020-11-21 22:49:49 +09:00
Hajime Hoshi
ddc8115b51 graphicsdriver/opengl: Refactoring: remove ensureGL 2020-11-21 22:09:58 +09:00
Hajime Hoshi
dd46221968 graphicsdriver/opengl: Enable dFdx for mobiles
Fixes #1404
2020-11-21 19:40:11 +09:00
Hajime Hoshi
b1d7a5f595 shaderir/glsl: Enable dFdx for WebGL
With WebGL1, an extension is required for dFdx. On the other hand,
with WebGL2, GLSL ES 300 is required and the extension is forbidden.
This change fixes shaderir/glsl to switch the output depends on the
WebGL version.

This change also adds a new build tag 'ebitenwebgl1' forcing WebGL 1.

Updates #1404
2020-11-21 19:07:54 +09:00
Hajime Hoshi
2097312a8b graphicsdriver/opengl: Refactoring 2020-11-21 16:44:49 +09:00
Hajime Hoshi
4df958c9fd Avoid comparing to js.Undefined() for consistency 2020-11-21 14:25:17 +09:00
Hajime Hoshi
ed494dbf59 restorable: Reland: Do not record pixels if restoring is not requried
This change also remove the restrictions of operations on
graphicscommand.Image. For example, now DrawTriangles and
ReplacePixels can be mixed on the same image.

Fixes #1022
2020-11-14 15:00:16 +09:00
Hajime Hoshi
86a0c7aa82 graphicsdriver/opengl: Use PBO when retrieving pixels 2020-11-13 09:10:56 +09:00
Hajime Hoshi
99b4a3096a graphicsdriver/opengl: Use Go const values instead of getting them dynamically 2020-11-08 19:23:32 +09:00
Hajime Hoshi
ed028110cf ebiten: Allow rendering on a sub-image by scissor test
Fixes #1255
2020-11-08 00:58:44 +09:00
Hajime Hoshi
a8f96ee9af graphicsdriver/metal: Add Sync to sync CPU and GPU asynchronously
Fixes #1414
2020-11-07 04:09:47 +09:00
Hajime Hoshi
f611b48c71 graphicsdriver/opengl: Use native GLES functions for mobiles
After this change, GL functions for mobiles, especially Android, are
native ones instead of golang.org/x/mobile/gl functions in order to
reduce goroutine context switches.

On gomobile-build, golang.org/x/mobile/gl functions are still used.

Fixes #1387
2020-10-19 03:51:20 +09:00
Hajime Hoshi
2740938460 graphicsdriver/opengl: Fix the error message again 2020-10-18 22:55:37 +09:00
Hajime Hoshi
b755a1f970 graphicsdriver/opengl: Fix the error message 2020-10-18 22:12:39 +09:00
Hajime Hoshi
cac4b43ddd graphicsdriver/opengl/gles: Add copyright comments 2020-10-18 18:18:08 +09:00
Hajime Hoshi
55af18a178 graphicsdriver/opengl: Use a new package gles
Updates #1387
2020-10-18 18:16:11 +09:00
Hajime Hoshi
eed619ad0f graphicsdriver/metal, graphicsdriver/opengl: Reland: Remove the thread usages for performance
Instead, graphicscommand package has a thread.

Updates #1367
2020-10-13 02:46:31 +09:00
Hajime Hoshi
713eee1117 Revert "graphicsdriver/metal, graphicsdriver/opengl: Remove the thread usages for performance"
This reverts commit 2942f10d9d.

Reason: Compile error on mobiles and runtime error on browsers
2020-10-13 02:12:02 +09:00
Hajime Hoshi
2942f10d9d graphicsdriver/metal, graphicsdriver/opengl: Remove the thread usages for performance
Instead, graphicscommand package has a thread.

Updates #1367
2020-10-13 01:50:54 +09:00
Hajime Hoshi
dc288d37f8 Bug fix: Compile error for Wasm 2020-10-07 02:23:45 +09:00
Hajime Hoshi
ee4ebaaa95 Clean up the 'js' build tags
Updates #1129
2020-10-07 02:07:03 +09:00