Commit Graph

1523 Commits

Author SHA1 Message Date
Hajime Hoshi
3f28592700 graphics: Refactoring: Remove PutVertex 2019-02-15 00:22:32 +09:00
Hajime Hoshi
7c506bc5bc restorable: Refactoring: Add (*Image).QuadVertices/PutVertex 2019-02-15 00:18:12 +09:00
Hajime Hoshi
a06a2b65c1 shareable: Fix semantically incorrect function usage
In this case, the size equals to the internal size, so this is not
a bug fix.
2019-02-14 23:23:52 +09:00
Hajime Hoshi
fd250c8d8c graphics: Rename NextPowerOf2Int -> InternalImageSize and add image size adjustment
There is a minimum internal image size on some system like old iOS
devices. This change adds adjustment of the size.

Issue: #810
2019-02-14 23:06:01 +09:00
Hajime Hoshi
a2fe3d5962 restorable: Refactoring: Use InternalSize instead of NextPowerOf2Int 2019-02-14 22:39:19 +09:00
Hajime Hoshi
4e8c7f0a75 restorable: Rename SizePowerOf2 -> InternalSize 2019-02-14 20:56:38 +09:00
Hajime Hoshi
a6d3a1e0cb graphicsdriver/metal: Refactoring: Use NextPowerOf2Int 2019-02-14 11:09:16 +09:00
Hajime Hoshi
a1b1bce43a graphicsdriver/metal: Bug fix: Some tests failed due to wrong source size 2019-02-14 11:06:30 +09:00
Hajime Hoshi
7a76a5b42d graphicsdriver/metal: Remove while loop in shader programs 2019-02-14 10:54:32 +09:00
Hajime Hoshi
5c7f34827f graphicsdriver/metal: Use template specialization 2019-02-14 09:57:47 +09:00
Hajime Hoshi
04dc1faa9c graphicsdriver/opengl: Call glFinish before glReadPixels
It looks like glFlush is not enough at least on Travis CI.

Fixes #814
2019-02-14 02:03:05 +09:00
Hajime Hoshi
0546783ad5 restorable: Don't call (*graphicscommand.Image).Pixels twice (2) 2019-02-14 01:00:27 +09:00
Hajime Hoshi
3faa674e32 restorable: Don't call (*graphicscommand.Image).Pixels twice 2019-02-14 00:54:02 +09:00
Hajime Hoshi
3952474690 graphics/metal: Fix comments 2019-02-13 23:36:45 +09:00
Hajime Hoshi
81101e0f48 graphicsdriver/metal: Reduce 'if' from shader programs (#762) 2019-02-13 23:28:17 +09:00
Hajime Hoshi
27dbf1bbb7 restorable: Record more drawing image history items
Fixes #813
2019-02-13 10:45:08 +09:00
Hajime Hoshi
6930176fbb restorable: Add restorable.Pixels 2019-02-13 00:46:24 +09:00
Hajime Hoshi
93d0b0dd09 restorable: Add Fill
This is useful to reduce opportunity to make the image stale.
2019-02-13 00:46:24 +09:00
Hajime Hoshi
40f728a326 shareable: Call (*restorable.Image).Clear() when possible
This is a kind of relanding of c68c36b0b7.
Clearing the restorable.Image state can reduce the operations for
restoring.
2019-02-13 00:41:26 +09:00
Hajime Hoshi
5fed3d3bed shareable: Add MakeVolatile 2019-02-13 00:41:24 +09:00
Hajime Hoshi
5147bbde9d restorable: Add MakeVolatile 2019-02-13 00:39:54 +09:00
Hajime Hoshi
f613cd1407 restorable: Remove Pixels that is not used anywhere 2019-02-13 00:31:00 +09:00
Hajime Hoshi
c2c3579cde graphicsdriver/opengl: Reduce 'if' in shader programs
Fixes #812
2019-02-12 12:46:18 +09:00
Hajime Hoshi
6c4260d0e1 Revert "graphicsdriver/opengl: Use GL_RGBA8 as the internal format at glTexImage2D"
This reverts commit f5044f3d8f.

Reason: This doesn't work on some iOS machines
2019-02-12 03:34:06 +09:00
Hajime Hoshi
4273f1982d devicescale: Bug fix: Need to consider Y axis direction on macOS
Fixes #807
2019-02-10 23:34:15 +09:00
Hajime Hoshi
8e42484294 graphicscommand: Add 'address' to (*DrawImageCommand).String 2019-02-10 14:27:49 +09:00
Hajime Hoshi
6f428c584d shareable: Add comments 2019-02-10 14:13:00 +09:00
Hajime Hoshi
339155f63d shareable: Use CompositeModeSourceOver when possible at Fill 2019-02-10 14:08:59 +09:00
Hajime Hoshi
1150fc69d0 shareable: Use color vertex values instead of ColorM
This is an optimization: using ColorM might cause graphics command
separation.
2019-02-10 14:02:01 +09:00
Hajime Hoshi
f5044f3d8f graphicsdriver/opengl: Use GL_RGBA8 as the internal format at glTexImage2D
Related: #810
2019-02-09 21:27:46 +09:00
Hajime Hoshi
815f2a6b35 shareable: Improve panic messages 2019-02-09 19:47:45 +09:00
Hajime Hoshi
a5421de8ab mainthread: Add comments 2019-02-08 20:32:00 -10:00
Hajime Hoshi
87b4b8b1b4 mainthread: Disable panic temporarily
Fixes #809
2019-02-08 20:11:48 -10:00
Hajime Hoshi
a3eddeb50f Improve panic messages 2019-02-06 23:43:03 -10:00
Hajime Hoshi
9d291f601e graphicsdriver/metal: Bug fix: Make all the tests pass 2019-02-06 23:42:54 -10:00
Hajime Hoshi
207ae08c9d graphicsdriver/metal: Give up reusing buffers
It was inevitable to rely on reference counts, which was too hacky.
Besides, reusing buffers doesn't improve performance.
2019-02-05 03:22:50 +09:00
Hajime Hoshi
19079ae7a2 graphicsdriver/metal: Fix comments 2019-02-05 03:09:40 +09:00
Hajime Hoshi
f29337dc93 graphicsdriver/metal: Add comments 2019-02-03 23:58:45 +09:00
Hajime Hoshi
882d0c0bc8 graphicsdriver/metal: Reuse MTLBuffer instead of re-creating (#762) 2019-02-03 22:55:29 +09:00
Hajime Hoshi
a8dcd5c628 Replace go-flock with flock 2019-02-03 14:20:20 +09:00
Hajime Hoshi
d3d56c076d shareable: Use CopyPixels
CopyPixels is basically Pixels and ReplacePixels, but executed
lazily while Pixels reads pixels from GPU immediately. Thanks to
this, restorable.Image no longer need to keep pixel data if not
needed.
2019-02-03 02:51:56 +09:00
Hajime Hoshi
b89602d900 restorable: Add more comments 2019-02-02 19:19:03 +09:00
Hajime Hoshi
05d78b4232 mainthread: Cause panic when trying to run before initialization 2019-02-02 19:00:15 +09:00
Hajime Hoshi
bcd9db669d Revert "restorable: Don't record pixels when restoring is disabled"
This reverts commit aad7bdc64d.

Reason: This causes application freezing at least on macOS
2019-02-02 18:39:51 +09:00
Hajime Hoshi
204b0e72d6 graphicsdriver/metal: Do not wait until completed when possible (#762) 2019-02-02 04:35:38 +09:00
Hajime Hoshi
aad7bdc64d restorable: Don't record pixels when restoring is disabled 2019-02-02 00:44:02 +09:00
Hajime Hoshi
5be567d58f ui: Implement restoring context lost on browsers correctly
Fixes #734
2019-02-01 01:20:40 +09:00
Hajime Hoshi
ba47a19b17 mobile: Bug fix: error must be received without waiting for renderCh
Even when error happens, the error was not received when renderCh
received. This was the cause of freezing when error happens.
2019-01-28 12:32:48 +09:00
Hajime Hoshi
3ac1996f9d clock: Avoid overflow by using time duration on Windows 2019-01-27 17:31:30 +09:00
Hajime Hoshi
3691083cee clock: Use a more precise timer on Windows
This change is based on @silbinarywolf's change:
https://github.com/hajimehoshi/ebiten/issues/798#issuecomment-457822280

Fixes #798
2019-01-26 21:16:35 +09:00