divVerent
f2209a0b51
internal/atlas: optimization: send premultiplied alpha from vertex to fragment shader. ( #1996 )
...
Note that this applies only to the builtin shaders - interface for Kage stays
unchanged for compatibility.
Minor compatibility delta: when interpolating alpha values, previous code has
created nonsense values, such as, when interpolating from
fully-transparent-black (0,0,0,0) to opaque-white (1,1,1,1), something like
half-transparent-grey (0.25,0.25,0.25,0.5) where half-transparent-white
(0.5,0.5,0.5,0.5) is used by the new code.
I assume this is a strict improvement, however this may warrant some testing.
Possible later improvement could be moving the premultiplication from fragment
shader to CPU. Did not do this as it makes the code rather inconsistent of Kage
vs built-in shader usage.
Updates #1772
2022-02-24 02:27:50 +09:00
Hajime Hoshi
8b7273b74a
internal/graphicsdriver/metal: call PresentDrawable only when necessary
2022-02-22 01:37:13 +09:00
Hajime Hoshi
ee911fd892
internal/graphicsdriver/metal: fix an error message
2022-02-20 22:01:36 +09:00
Hajime Hoshi
ab1ad2c72f
.github/workflow: add a test to build with the build tag ebitencbackend
2022-02-13 16:57:48 +09:00
Hajime Hoshi
1c57393393
internal/graphicsdriver/metal: refactoring
2022-02-13 01:00:20 +09:00
Hajime Hoshi
162f62f54e
internal/graphicsdriver/metal/mtl: bug fix: test compile error
2022-02-11 23:23:22 +09:00
Hajime Hoshi
176e984a58
internal/ui: refactoring: remove dependency on the package mtl
2022-02-11 23:11:49 +09:00
Hajime Hoshi
6f3c6d6c1b
internal/graphicsdriver/meta: rename function
2022-02-11 22:47:13 +09:00
Hajime Hoshi
cc4e2f08be
internal/graphicsdriver/metal: rename files
2022-02-11 21:49:05 +09:00
Hajime Hoshi
4c6c31e384
all: reorder build tags in an alphabetical order
2022-02-08 15:49:15 +09:00
Hajime Hoshi
df60c4c92d
internal/driver: rename to internal/graphicsdriver
2022-02-06 20:41:32 +09:00
Hajime Hoshi
84e53d4c61
internal/graphicsdriver/opengl, internal/uidriver/glfw: treat Win32 API errors correctly
...
The returned errors from syscall.Syscall* and windows.LazyProc.Call come
from GetLastError. The value of GetLastError is not reliable when the
function succeeds.
This change fixes the usages of error values. The error value is now
used only when the API explicitly fails.
2022-01-30 15:54:24 +09:00
Hajime Hoshi
d0a6ce6567
internal/graphicsdriver/metal: disable presentsWithTransaction in the fullscreen mode
...
Updates #1745
Closes #1974
2022-01-26 03:55:14 +09:00
Hajime Hoshi
cdf2335f5a
refactoring: better error handlings on Windows
2022-01-23 18:30:40 +09:00
Hajime Hoshi
1b498a03cc
Revert "internal/graphicsdriver/metal: Bug fix: Vsync didn't work on macOS"
...
This reverts commit 1dd13ae06e
.
Reason: This caused FPS drop on macOS 12.0.1
Updates #1885
Closes #1939
2022-01-09 01:02:53 +09:00
Hajime Hoshi
3b0ce21a56
Revert "internal/graphicsdriver: bug fix: render semi-transparent vectors correctly"
...
This reverts commit 202f642395
.
Reason: TestImageEvenOdd failed
Updates #1933
2022-01-06 03:19:46 +09:00
Hajime Hoshi
202f642395
internal/graphicsdriver: bug fix: render semi-transparent vectors correctly
...
Closes #1933
2022-01-06 03:00:25 +09:00
Hajime Hoshi
6b34ddecfa
internal/graphicsdriver/opengl/gles: add GLES_SILENCE_DEPRECATION to suppress warnings
2022-01-05 01:54:00 +09:00
Hajime Hoshi
1799ed0b28
add a build tag 'ebitencbackend' and internal/cbackend
...
This enables to create a C archive with Ebiten without an actual driver
implementation. This enables Ebiten work on a platform Go doesn't support.
See also Hitsumabushi project: github.com/hajimehoshi/hitsumabushi.
The backend C API is not stable and might change later. Then, the build
tag 'ebitencbackend' is not documented on purpose.
Closes #1900
2021-12-22 21:12:48 +09:00
Hajime Hoshi
1dd13ae06e
internal/graphicsdriver/metal: Bug fix: Vsync didn't work on macOS
...
This fix works only for Metal. There is not a good solution for
OpenGL so far unfortunately.
Closes #1885
2021-11-27 02:52:48 +09:00
Hajime Hoshi
00e2b15e2a
shaderir: Bug fix: A wrong argument for fmt.Sprintf
...
This change also improves the result of espcae analysis.
Closes #1863
2021-11-02 00:05:07 +09:00
Hajime Hoshi
7661147e31
internal/graphicsdriver/opengl: Avoid allocations by escaping to heap
2021-10-31 22:34:14 +09:00
Hajime Hoshi
15f62bfeb5
internal/graphicsdriver/opengl: Optimization: Cache texture variable names
2021-10-31 05:40:44 +09:00
Hajime Hoshi
9d51356eef
internal/graphicsdriver/opengl: Optimization
2021-10-31 05:17:23 +09:00
Hajime Hoshi
b74a4a0275
internal/graphicsdriver/opengl: Optimization: Avoid heap allocations
2021-10-31 02:10:44 +09:00
Hajime Hoshi
7b7791156c
internal/graphicsdriver/opengl: Remove unreached return
2021-10-31 01:38:01 +09:00
Hajime Hoshi
98083ccd0a
internal/graphicsdriver/opengl: Avoid heap allocation of a local variable
...
If a variable is passed to an argument interface{}, the variable might be
allocated on the heap unexpectedly.
2021-10-31 01:11:12 +09:00
Hajime Hoshi
a082db04fd
internal/jsutil: Optimization: Avoid using empty interface{} conversions
2021-10-30 18:53:21 +09:00
Hajime Hoshi
a826ecb29b
internal/jsutil: Move a function to internal/graphicsdriver/opengl
2021-10-30 18:33:43 +09:00
Hajime Hoshi
06f4142ca0
internal/driver: Optimization: Replace interface{} with driver.Uniform
...
Converting a value from/to interface{} can create a value in heap
and this is not efficient.
2021-10-30 02:58:28 +09:00
Hajime Hoshi
1f82bb297c
internal/graphicsdriver/opengl: Optimization: Avoid the empty interface
2021-10-30 02:28:57 +09:00
Hajime Hoshi
60f2c7ace6
internal/graphicsdriver/opengl: Optimization: Avoid creating slices for every frame (uniform variables)
2021-10-30 00:22:31 +09:00
Hajime Hoshi
b4f45edff8
internal/graphicsdriver/opengl: Optimization: Avoid creating slices for every frame
2021-10-30 00:13:57 +09:00
Hajime Hoshi
76324254c1
internal/graphicsdriver/opengl: Avoid creating objects for debugging
2021-10-30 00:04:03 +09:00
Hajime Hoshi
d3ac199aa9
internal/graphicsdriver/opengl: Optimization: Avoid fmt.Sprintf
2021-10-29 21:43:40 +09:00
Hajime Hoshi
3c1f8da7f8
internal/graphicsdriver/opengl: Optimization: Avoid interface conversion
2021-10-29 21:35:40 +09:00
Hajime Hoshi
99bfdef416
internal/graphicsdriver/opengl/gl: Support OpenBSD
2021-10-24 15:09:16 +09:00
Hajime Hoshi
ef62f407d1
Clean up build tags
2021-10-24 15:05:36 +09:00
Hajime Hoshi
878831b842
internal/graphicsdriver/opengl: Bug fix: compile error
2021-10-24 14:55:50 +09:00
Hajime Hoshi
a5198275fa
internal/graphicsdriver/opengl/gl: Remove an unused file
2021-10-24 14:46:38 +09:00
Hajime Hoshi
3f5d1762bb
internal/graphicsdriver/opengl: Return an error when initializing OpenGL fails
...
Updates #1838
2021-10-06 00:38:47 +09:00
Hajime Hoshi
7be00d79e8
internal/uidriver/glfw: Fix unstable FPS on fullscreen on macOS
...
FPS was unstable on fullscreen mode i.e., when the view size is the
same as the monitor size.
By using a little different size view, FPS becomes stable.
Updates #1745
2021-09-18 19:22:09 +09:00
Hajime Hoshi
11b9a4b161
internal/graphicsdriver/metal: Refactoring
2021-09-18 17:24:03 +09:00
Hajime Hoshi
65943d4bad
internal/graphicsdriver/metal: Disable presentsWithTransaction on iOS
...
Closes #1799
2021-09-07 00:02:58 +09:00
Hajime Hoshi
58ea710a84
internal/affine: Rename UnsafeElements -> Elements as this is no longer unsafe
2021-09-04 18:08:27 +09:00
Hajime Hoshi
df710a5c63
internal/affine: Change UnsafeElements to take arguments
...
This will enable to suppress unnecessary array allocations in the
future.
Updates #1796
2021-09-04 17:38:30 +09:00
Hajime Hoshi
d1c764640d
internal/glfw, internal/graphicsdriver/opengl/gl: Use the last byte to detect a bool
...
When a C function returns a bool value, only the first byte of a
uintptr value matters. When we want to get a bool value from a C
function, filter this for sefety.
2021-08-25 02:09:55 +09:00
Hajime Hoshi
35deb53624
internal/graphicsdriver/metal: Rename files to remove +build comments
2021-08-23 02:06:09 +09:00
Hajime Hoshi
6c8a7d1079
internal/graphicsdriver/opengl: Bug fix: A location cache map must be reset when a program is deleted
...
Closes #1753
2021-08-15 04:54:20 +09:00
Hajime Hoshi
da08577095
internal/graphicsdriver/opengl: Refactoring
2021-08-14 04:05:18 +09:00
Hajime Hoshi
ce8fc39451
internal/graphicsdriver/opengl: Bug fix: the current program must be reset
...
Updates #1751
2021-08-13 23:44:30 +09:00
Hajime Hoshi
15ac69b8d5
internal/graphicsdriver/metal: Bug fix: Disable presentsWithTransaction on fullscreen
...
Closes #1745
2021-08-08 17:40:37 +09:00
Hajime Hoshi
ec26b1a43b
internal/graphicsdriver/metal: Refactoring: Remove vsyncInited
2021-08-08 15:30:13 +09:00
Hajime Hoshi
cc1accc32a
internal/uidriver/glfw: Bug fix: Disable vsync when resizing the window
...
Closes #1740
2021-08-06 03:08:04 +09:00
Hajime Hoshi
8967384dac
internal/graphicsdriver: Bug fix: getting a WebGL2 context might fail even though WebGL2RenderingContext exists
...
Closes #1738
2021-08-01 22:00:47 +09:00
Hajime Hoshi
e4329d0349
internal/driver: Refactoring: Reduce dependencies on affine
2021-07-27 12:19:50 +09:00
Hajime Hoshi
21aa96f9f5
internal/affine: Refactoring: Make ColorM interface
2021-07-27 12:10:22 +09:00
Hajime Hoshi
7e5b259dd2
internal/affine: Use a pointer of an array for UnsafeElements
2021-07-26 21:19:53 +09:00
Hajime Hoshi
50d2d7ed61
internal/graphicsdriver/opengl: Remove unused code using PBO
...
Updates #1678
2021-07-14 21:51:27 +09:00
Hajime Hoshi
b0106e95b9
internal/restorable: Bug fix: Test failed on macOS (Metal)
2021-07-09 20:21:04 +09:00
Hajime Hoshi
4573883b03
internal/graphicsdriver/metal: Make FPS stable by 'presentsWithTransaction'
...
Closes #1196
2021-07-08 18:11:19 +09:00
Hajime Hoshi
ae0e30196b
internal/graphicsdriver/metal: Bug fix: The store action must always be 'store'
...
Closes #1700
2021-07-08 17:39:37 +09:00
Hajime Hoshi
337d8d5113
internal/graphicsdriver/metal: Separate GCing the buffers
...
Updates #1196
2021-07-08 02:10:26 +09:00
Hajime Hoshi
edc2f8b961
internal/graphicsdriver/metal: Delay to get a texture for nextDrawable
...
See https://developer.apple.com/documentation/quartzcore/cametallayer
> To avoid stalls in your app, request a new drawable only when you
> need it, and release any references to it as quickly as possible
> after you’re done with it.
Updates #1196
2021-07-08 01:56:14 +09:00
Hajime Hoshi
b314b6b9b6
Revert "internal/graphicsdriver/metal: Do not retain MTLCommandBuffer for MTLBuffer"
...
This reverts commit e0fbfc2bb0
.
Reason: Rendering issue
Closes #1699
2021-07-08 00:27:33 +09:00
Hajime Hoshi
6213c17abc
internal/driver: Add Graphics.Initialize
2021-07-07 13:58:42 +09:00
Hajime Hoshi
e0fbfc2bb0
internal/graphicsdriver/metal: Do not retain MTLCommandBuffer for MTLBuffer
...
Before this change, a command buffer is retained indirectly by
a buffer, and this might extend the life of drawable unexpectedly.
This change stops using command buffers as a key of the buffers pool,
and use a counter increated by nextDrawable calls.
Updates #1196
2021-07-07 02:52:04 +09:00
Hajime Hoshi
80ac0646d5
internal/graphicsdriver/metal: Optimize the screen writing
2021-07-07 02:07:09 +09:00
Hajime Hoshi
38ce325958
internal/graphicsdriver/metal: Skip clearing the screen on Metal
2021-07-07 01:45:51 +09:00
Hajime Hoshi
9cb1ff9cea
internal/graphicsdriver/metal: Set framebufferOnly true
...
Updates #1196
2021-07-07 00:38:55 +09:00
Hajime Hoshi
bd3f16dbba
internal/graphicsdriver/metal: Change the order of GCed buffers
...
As a big buffer is likely reused, we should remove smaller buffers
first.
Updates #1196
2021-07-06 21:56:27 +09:00
Hajime Hoshi
09bd8b6f4a
internal/graphicsdriver/metal: Remove println
...
Updates #1196
2021-07-06 21:51:57 +09:00
Hajime Hoshi
ee2f891fcc
internal/graphicsdriver/metal: Reuse MTLBuffer objects
...
In Metal, MTLBuffer objects are not 'transient' and are expensive
to create. Reuse them whenever possible.
See also: https://developer.apple.com/library/archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Cmd-Submiss/Cmd-Submiss.html
Updates #1196
2021-07-06 21:48:54 +09:00
Hajime Hoshi
be1a0e90e7
internal/graphicsdriver/metal: Bug fix: TestImageEvenOdd failed
...
RenderCommandEncoder must be reset whenever the stencil mode is
'prepareStencil' in order to clear the stencil buffer.
2021-07-06 15:11:23 +09:00
Hajime Hoshi
3670b7dd62
internal/graphicsdriver/metal: Reuse DepthStencilState objects
...
In Metal, *State objects are not 'transient' and are expensive to
create. Reuse them whenever possible.
See also: https://developer.apple.com/library/archive/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Cmd-Submiss/Cmd-Submiss.html
2021-07-06 15:10:05 +09:00
Hajime Hoshi
ab26312108
internal/graphicsdriver/metal: Release objects appropriately
2021-07-06 14:20:19 +09:00
Hajime Hoshi
17d8cb5311
internal/graphicsdriver/metal: Bug fix: Crashed with METAL_DEVICE_WRAPPER_TYPE=1
...
Closes #1697
2021-07-06 14:06:06 +09:00
Hajime Hoshi
63a00f6171
internal/graphicsdriver/metal/mtl: Bug fix: Test failure
...
Closes #1696
2021-07-05 21:28:25 +09:00
Hajime Hoshi
674802d2f5
ebiten: Bug fix: Draw commands with EvenOdd should not be merged
...
Updates #1684
2021-07-05 18:08:55 +09:00
Hajime Hoshi
daa883d799
ebiten: Bug fix: Stencil buffers should not be cleared until all the vertices are rendered
...
Updates #1684
2021-07-05 17:41:06 +09:00
Hajime Hoshi
b466a0cbd7
ebiten: Add EvenOdd to DrawTrianglesOptions and DrawShaderTrianglesOptions
...
Updates #844
Closes #1684
2021-07-05 03:35:55 +09:00
Hajime Hoshi
5c4d3325f6
internal/graphicsdriver/opengl: Add APIs for stencil buffers
...
Updates #1684
2021-07-05 00:24:44 +09:00
Hajime Hoshi
b8bf277825
internal/graphicsdriver/metal/mtl: Add APIs for stencil buffers
...
Updates #1684
2021-07-05 00:11:25 +09:00
Hajime Hoshi
19f034e818
internal/graphicsdriver/metal: Refactoring
2021-07-04 20:35:56 +09:00
Hajime Hoshi
3ec02f767b
internal/graphicsdriver/metal: Refactoring
2021-07-04 18:37:14 +09:00
Hajime Hoshi
7f86761dde
internal/graphicsdriver/metal: Reuse RenderCommandEncoder when possible
2021-07-04 18:13:18 +09:00
Hajime Hoshi
7668052a6b
internal/graphicsdriver/metal: Update the view only when necessary
2021-07-04 17:24:39 +09:00
Hajime Hoshi
f6e210e086
internal/graphicsdriver/opengl: Refactoring: Remove redundant conversions
2021-07-03 22:39:48 +09:00
Hajime Hoshi
56f4e6b2d0
internal/graphicsdriver/opengl: Refactoring: Rename a variable
2021-07-03 02:41:37 +09:00
Hajime Hoshi
269ea7c489
internal/graphicsdriver/opengl: Refactoring: Reorder functions
...
glPixelStorei affects the result of glTexImage2D. This change makes
this fact more explicit.
2021-07-03 02:09:47 +09:00
Hajime Hoshi
6b95dd0d4d
internal/graphicsdriver/metal: Refactoring: Unify two drawTriangles* functions
2021-07-02 00:25:43 +09:00
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
77b198211c
internal/graphicsdriver/metal: Add a comment
2021-02-27 04:04:25 +09:00
Hajime Hoshi
53352cf2b3
internal/graphicsdriver/metal: Use the smallest temporary texture
...
Updates #1517
2021-02-27 03:45:19 +09:00
Hajime Hoshi
673627c4d4
internal/graphicsdriver/metal: Optimization
2021-02-27 02:30:20 +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
ddfb8adbc4
graphicsdriver/metal: Asynchronous sending pixels
...
Fixes #1418
2020-11-10 22:48:03 +09:00
Hajime Hoshi
5705dc79fb
graphicsdriver/metal: Do not need to wait until flushing at Sync
2020-11-10 22:12:26 +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
e09f3aa286
graphicsdriver/metal/mtl: Bug fix: Fix the guard range
2020-11-08 04:44:43 +09:00
Hajime Hoshi
aaff18ecf7
graphicsdriver/metal/mtl: Bug fix: Guard the handler map by a mutex
...
The handler is invoked in another thread than the main thread.
2020-11-08 04:40:13 +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
e4e8e7254e
graphicsdriver/metal/mtl: Refactoring: Specify struct member names explicitly
2020-11-07 23:46:07 +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
6e3cbe2e33
graphicsdriver/metal/mtl: Refactoring
2020-11-07 03:26:35 +09:00
Hajime Hoshi
8da5ad2c4f
graphicsdriver/metal: Misspelling
2020-11-03 23:44:40 +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
fe6a2daef4
graphicsdriver/metal: Bug fix: Had to set the vsync state again at resetting
...
Fixes #1364
2020-10-14 01:58:56 +09:00
Hajime Hoshi
249e1c46ba
graphicsdriver/metal: Remove an old comment
...
Updates #1367
2020-10-14 01:51:18 +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
e90b5ff277
Update import paths in the documents
2020-10-04 05:07:08 +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
52fcab7a90
graphicsdriver/metal: Fix comments
2020-09-06 16:51:44 +09:00
Hajime Hoshi
e565433fb0
graphicsdriver/metal: Bug fix: Synchronizing textures on iOS was necessary
...
Fixes #1337
2020-09-06 16:19:50 +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
a3b41515a9
ui: Replace the native window's type (unsafe.Pointer) with uintptr
...
Updates #1306
2020-09-04 00:51:48 +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
4d1947f711
grpahicsdriver/metal: Better error message
2020-08-09 04:06:30 +09:00
Hajime Hoshi
a45e241da1
shaderir/metal: Implement the shader IR compiler for Metal
...
Fixes #1165
2020-08-08 19:14:57 +09:00
Hajime Hoshi
2b89710600
graphicsdriver/metal: Refactoring
2020-08-08 18:05:58 +09:00
Hajime Hoshi
6dc74d308b
graphicsdriver/metal: Rename viewportSize to internalSize and use it more
2020-08-08 16:07:14 +09:00
Hajime Hoshi
b4046a795e
graphics: Reduce the usage of InternalImageSize
2020-08-08 16:01:33 +09:00
Hajime Hoshi
fe1cea533a
graphicsdriver/metal: Add a generalized 'draw' function
...
This is a preparation for rendering shaders.
Updates #1165
2020-08-08 03:12:44 +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
eb056690aa
graphicsdriver/metal: Update the minimum macOS version to 10.12 for Go 1.15
2020-07-25 04:18:26 +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
Hajime Hoshi
6ccb614b08
graphicsdriver/metal: Implement CompositeModeMultiply
...
Updates #410
2020-07-18 21:51:57 +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