Hajime Hoshi
ff2dd6fe7e
internal/graphicsdriver/opengl: Refactoring: Unify two drawTriangles* functions
2021-07-02 00:02:21 +09:00
Hajime Hoshi
e9b6237f61
internal/driver: Refactoring: Merge two Draw* functions
2021-07-01 15:55:48 +09:00
Hajime Hoshi
b9d52c0267
internal/driver: Change InvalidImageID/InvalidShaderID to 0
2021-07-01 14:58:55 +09:00
Hajime Hoshi
73bf1f36e5
internal/driver: Define InvalidImageID / InvalidShaderID
2021-07-01 13:56:42 +09:00
Hajime Hoshi
067e3c004d
Remove internal/web
2021-06-26 17:04:00 +09:00
Hajime Hoshi
8ff42f55a1
internal/graphicsdriver/opengl: Give up restorign on browsers
...
Using restorable images is expensive as this sometimes requires to
load pixels from GPU. On browsers, just reloading the application
should be fine when the context lost happens.
Closes #1603
2021-06-26 16:54:21 +09:00
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
Hajime Hoshi
7a0e31a23a
Clean up the 'js' build tags
...
Updates #1129
2020-10-07 01:33:10 +09:00
Hajime Hoshi
bf515bb594
Update version to v2.0.0-alpha
2020-10-04 04:30:40 +09:00
Bui Quoc Trong
0d29979296
Fix the comment style cause heading in pkgsite ( #1369 )
2020-09-29 16:55:39 +09:00
Hajime Hoshi
3dab49fc39
graphicsdriver/opengl: Better error message
2020-09-17 20:35:57 +09:00
Hajime Hoshi
68c43bb4fb
graphicsdriver/opengl: Enable to compile with gldebug tag for gomobile
2020-09-04 15:08:40 +09:00
Hajime Hoshi
bd888f62b9
graphicsdriver/opengl: Exclude bytes.go from non-mobile environments
...
This requires reflect and reflect prevents Ebiten from being compiiled
with TinyGo.
Updates #747
2020-08-20 22:24:21 +09:00
Hajime Hoshi
c921a63c21
graphicsdriver/opengl/gl: Bug fix: Crash on Parallels
...
Fixes #1310
2020-08-18 04:33:59 +09:00
Hajime Hoshi
609a3c4e22
ebiten: Bug fix: Fix the texel calculation
...
In shaders, texCoord is always in texture0's texels. Convert them
at imageNTextureAt functions correctly.
Fixes #1290
2020-08-11 04:15:07 +09:00
Hajime Hoshi
69f87d5fd1
ebiten: Add new shader builtin functions: image[N]TextureBoundAt
...
Fixes #1287
2020-08-11 03:24:54 +09:00
Hajime Hoshi
b4046a795e
graphics: Reduce the usage of InternalImageSize
2020-08-08 16:01:33 +09:00
Hajime Hoshi
28c638cb5b
graphicsdriver/opengl: Unexpose NewShader
2020-08-08 03:12:44 +09:00
Hajime Hoshi
8bac08cbd9
Add internal/shaderir/glsl
2020-08-03 23:27:27 +09:00
Hajime Hoshi
38dcadb233
graphicsdriver/opengl: Add program error info to the error
2020-08-01 18:58:05 +09:00
Hajime Hoshi
a4334c5464
shader: Use arrays at uniform variables
...
Fixes #1274
2020-08-01 17:22:10 +09:00
Hajime Hoshi
073fd329f2
graphicsdriver/opengl: Enable to pass any type of uniform variables
...
Updates #1274
2020-08-01 05:11:24 +09:00
Hajime Hoshi
a50ef46ed0
graphicsdriver/opengl: Do not allow nil value for uniform variables
2020-08-01 02:01:51 +09:00
Hajime Hoshi
da5642cd0e
graphicsdriver/opengl: Add type checks of uniform variables
2020-08-01 02:01:51 +09:00
Hajime Hoshi
a0197d4c2f
graphicsdriver/opengl: Bug fix: Build error on Android
...
Fixes #1266
2020-07-26 17:01:11 +09:00
Hajime Hoshi
ca3fd4eaa4
ebiten: Add texture[ID]Size functions for shaders
...
Fixes #1239
2020-07-26 15:18:01 +09:00
Hajime Hoshi
d08a04a635
ebiten: Refactoring
2020-07-26 15:05:00 +09:00
Hajime Hoshi
75d34ab585
graphicsdriver/opengl: Forbids PBO on Raspberry Pi 4 ( #1261 )
...
Fixes #1208
2020-07-23 19:15:34 +09:00
Hajime Hoshi
29d53edf1d
graphicsdriver/opengl: Bug fix: Rename the attribute variables along with custom shaders
2020-07-20 04:06:35 +09:00
Hajime Hoshi
5506491c03
graphicsdriver/opengl: Bug fix: Binding the same texture multiple times did not work
...
Updates #1193
2020-07-19 04:34:53 +09:00
Hajime Hoshi
36e9803cea
shader: Enable to get pixels from multiple images
...
Updates #1193
2020-07-19 02:33:43 +09:00
Hajime Hoshi
fe79bb27af
graphicscommand: Refactoring
2020-07-18 23:25:16 +09:00
nanoslayer
72babcd420
ebiten: Add CompositeModeMultiply ( #1251 )
...
This change adds a new composite mode called `CompositeModeMultiply`,
which multiplies the source color with the destination color.
This is tested on Linux and Windows only.
Fixes #410
2020-07-18 21:37:17 +09:00
Hajime Hoshi
e0d5763a60
shader: Use the fixed number of images for shaders
...
This changes uses arrays rather than slices in order to avoid heap
allocations.
Updates #1193
2020-07-18 18:27:47 +09:00
Hajime Hoshi
7f70797a6d
ebiten: Rename DrawTriaglesWithShaderOptions.Textures to Images
2020-07-15 03:49:05 +09:00
Hajime Hoshi
d217bc6033
ebiten: Sparate textures from uniforms at DrawTrianglesWithShader
...
Updates #1193
Updates #1239
2020-07-09 01:59:21 +09:00
Hajime Hoshi
4021c24534
shader: Separate uniform variables and texture variabls
...
Textures cannot be treated as a regular variable, then they should
be treated differently from other uniform variables.
Add a new function texture0At replacing texture2D.
Updates #1239
2020-07-08 01:12:07 +09:00
Hajime Hoshi
b83f0acc4d
Remove source-region information from vertices
...
Fixes #1210
2020-07-02 23:38:39 +09:00
Hajime Hoshi
71c9e7ac40
driver: Add Region and sourceRegion parameter at Draw
...
This is a preparation to remove source-region information from
vertices.
Updates #1210
2020-07-02 03:26:05 +09:00
Hajime Hoshi
d3613e13af
graphicsdriver/opengl: Fix comments
2020-06-25 01:06:30 +09:00
Hajime Hoshi
2a63512c6e
driver: Add AddressUnsafe
...
This skips the source-region check and reduces 'if' branches from
shader programs.
AddressUnsafe is internal only so far. We might expose this value
later.
Updates #1210
2020-06-25 01:00:38 +09:00
Hajime Hoshi
bfc2fffba6
graphicsdriver/opengl: Move comments
2020-06-24 23:52:39 +09:00
Hajime Hoshi
20b5be0886
graphicsdriver: Bug fix: Tie-breaking when picking a texel
...
When a texel is picked on texel-borders of a texture, the behavior
(tie-breaking) depends on GPU and unexpected. This change fixes this
issue by shifting 1/512 [texel] when picking a texel up.
Updates #1212
2020-06-24 20:51:16 +09:00
Hajime Hoshi
1785b6a670
examples/moire: Add a smaller scale, and remove AdjustTexel function from shaders
...
This can reproduce the bug reported at #669 .
Apparently, the fix (8827520d4a
) is
no longer required after 3550abef7a
.
That's pretty odd, but examples/moire proves this fact.
Updates #669
Updates #759
2020-06-15 00:29:34 +09:00
Hajime Hoshi
f39c591252
shader: Enable more Go syntax
2020-06-11 01:13:03 +09:00
Hajime Hoshi
e25a6f4d46
graphicsdriver/opengl: Remove isTexture on desktops
2020-05-30 20:56:13 +09:00
Hajime Hoshi
2bdef2e8c4
restorable: Add an explicit way to detect context-lost
...
isTexture was used to detect context-lost and called every frame.
This was not good for performance.
This change adds a way to notify context-lost from the WebGL
handlers directly, and the package restorable uses it instead of
calling (*Image).isInvalaidated.
Fixes #1175
2020-05-30 20:29:15 +09:00
Hajime Hoshi
1c980a16f5
graphicsdriver/opengl: Ignore non-existent uniform locations
...
Shader users should not have to care about the existence of uniform
variables.
Updates #1168
2020-05-27 11:39:11 +09:00
Hajime Hoshi
f80719ef9a
driver: Use slices for uniform variables instead of maps
...
Fixes #1172
2020-05-26 23:50:11 +09:00
Hajime Hoshi
1cfc1964bf
graphicsdriver/opengl: Bug fix: fmt arguments
2020-05-25 02:36:45 +09:00
Hajime Hoshi
85730b433e
graphicsdriver: Bug fix: Pass texture natives as uniform variables correctly
2020-05-25 02:31:54 +09:00