Commit Graph

1124 Commits

Author SHA1 Message Date
Hajime Hoshi
9c408dce7c shareable: Lazy allocation (#592)
Clear is called when an image becomes a render target, and it
looks like Clear causes the memory spikes.

Before this change, when an image is created, shared region on a GL
texture is allocated. After that, the image's region is copied to
non-shared region when the image becomes a rendering target.

After this change, an image is not allocated on a GL texture first,
and allocated only when it is necessary. Then, Clear calls can be
avoided as much as possible.
2018-04-29 18:51:51 +09:00
Hajime Hoshi
916c7aac8a restorable: Fix comments 2018-04-29 13:49:33 +09:00
Hajime Hoshi
45afb6db67 Reland: restorable: Merge Clear to ReplacePixel 2018-04-29 13:40:18 +09:00
Hajime Hoshi
613f384cb5 graphics: Add EBITEN_DUMP_IMAGES_KEY
Fixes #589
2018-04-28 22:08:20 +09:00
Hajime Hoshi
eb357f61b5 restorable: Bug fix: Calling At must resolve the image's stale state 2018-04-28 21:56:20 +09:00
Hajime Hoshi
b22cc9d4be Add periods after 'DO NOT EDIT' 2018-04-28 03:37:19 +09:00
Hajime Hoshi
0bc712422f restorable: Bug fix: Remove SetFinalizer for disposing
SetFinalizer causes concurrent issue
2018-04-27 12:08:59 +09:00
Hajime Hoshi
dff492955d shareable: Reset finalizer in any cases 2018-04-26 01:51:57 +09:00
Hajime Hoshi
1cf4f30541 Revert "restorable: Merge Clear to ReplacePixels"
This reverts commit fb641d88cd.

Reason: When restoring the image where ReplacePixels is called,
dummyImage might not be restored since there is no record of
relationships between this image and dummyImage. Now pixels is not
nil when reverting by chance, but this would cause problems in the
future.
2018-04-25 22:31:48 +09:00
Hajime Hoshi
fb641d88cd restorable: Merge Clear to ReplacePixels
This can avoid unnecessary stale images that requires loading
pixels from GPU.
2018-04-25 01:30:57 +09:00
Hajime Hoshi
1571e04753 Revert "graphics: Call glFlush after glTexSubImage2D for MacBook Pro"
This reverts commit 7f5719fadd.

Reason: This didn't change the situation
2018-04-22 22:06:38 +09:00
Jake Bentvelzen
2f4ca72dbd input: Add Pause and Print Screen buttons (#555)
Fixes #579
2018-04-21 09:36:28 -07:00
Hajime Hoshi
3fa2beb502 Fix the do-not-edit comment https://golang.org/s/generatedcode 2018-04-20 00:54:33 -07:00
Hajime Hoshi
b691e73342 Revert "graphics: Experimental fix: call glFlush always after glTexSubImage2D"
This reverts commit d2da77eb96.

Reason: This doesn't solve the issue on MacBook Late 2013.
2018-04-14 23:16:26 +09:00
Hajime Hoshi
d2da77eb96 graphics: Experimental fix: call glFlush always after glTexSubImage2D 2018-04-14 23:06:20 +09:00
Hajime Hoshi
7f5719fadd graphics: Call glFlush after glTexSubImage2D for MacBook Pro 2018-04-14 17:59:10 +09:00
Hajime Hoshi
d1ef57c280 input: Remove the last period from do-not-edit comment 2018-04-14 04:22:09 +09:00
Hajime Hoshi
61d4df0e04 input: Add numpad keys for Edge (#580) 2018-04-14 02:43:31 +09:00
Hajime Hoshi
dd6110fbf8 input: Add KeyNumLock (#580) 2018-04-14 02:43:26 +09:00
Hajime Hoshi
5229e5a713 input: Add numpad keys except for Edge browser (#580) 2018-04-14 02:43:21 +09:00
Hajime Hoshi
4708d4a6f9 Add internal/png 2018-04-10 04:17:41 +09:00
Hajime Hoshi
070c8ec737 shareable: Rename variables 2018-04-09 02:18:46 +09:00
Hajime Hoshi
899f007fd0 ui: Panic when error is found on mobile 2018-04-07 03:33:20 +09:00
Hajime Hoshi
2d3c6ab5b8 ui: Remove build tag 'gomobilebuild'
Fixes #573
2018-04-07 02:14:54 +09:00
Hajime Hoshi
9902497e3d test: Use flock to make tests exclusive
Fixes #575
2018-04-07 00:59:52 +09:00
Hajime Hoshi
e77eb9f80f shareable: Temporary disable tests (#575) 2018-04-06 03:47:05 +09:00
Hajime Hoshi
cc725b99af restorable: Replace emptyImage with dummyImage 2018-04-06 03:08:52 +09:00
Hajime Hoshi
70f16daafd restorable: Fix tests (wrong assumption was used) 2018-04-06 02:15:49 +09:00
Hajime Hoshi
7b5ad46e49 shareable: NewImage* now returns a cleared image 2018-04-06 02:08:12 +09:00
Hajime Hoshi
1a335032a2 shareable: Bug fix: backend's restorable image must be disposed 2018-04-06 01:12:08 +09:00
Hajime Hoshi
8ff79c970a shareable: Use defer for tests 2018-04-05 12:02:08 +09:00
Hajime Hoshi
24e20306f2 restorable: Move 'putting random-colored dot' to restorable 2018-04-05 11:18:28 +09:00
Hajime Hoshi
810dc33b4a shareable: Fix comments 2018-04-05 02:41:50 +09:00
Hajime Hoshi
15dcd5764d shareable: Add shareable_test 2018-04-05 02:35:30 +09:00
Hajime Hoshi
6680b4f8d5 shareable: Bug fix: wrong source image rect in ensureNotShared 2018-04-05 01:07:36 +09:00
Hajime Hoshi
92e5bc31dc shareable: Refactoring 2018-04-05 00:40:35 +09:00
Hajime Hoshi
fcf4657a70 ui: Adjust touch positions at ui package (mobile) 2018-04-03 01:50:07 +09:00
Hajime Hoshi
76cb43a7f8 input: Refactoring: Remove unused arguments 2018-04-03 01:21:52 +09:00
Hajime Hoshi
0f2beab260 ui: Adjust touch positions in ui package (js) 2018-04-03 00:53:09 +09:00
Hajime Hoshi
c540d0fc0d ui: Add AdjustedTouches for consistency 2018-04-02 01:54:44 +09:00
Hajime Hoshi
e44a930bbb input: Refactoring 2018-04-02 01:19:42 +09:00
Hajime Hoshi
7d2fd9654a input: Adjust mouse cursor position in ui package 2018-04-01 23:53:26 +09:00
Hajime Hoshi
4de2dc0240 Add input package 2018-04-01 23:20:45 +09:00
Hajime Hoshi
e14c05b0fe shareable: Add comments 2018-03-26 00:13:26 +09:00
Hajime Hoshi
ab7a3e1ab3 graphics: Remove unneeded mutex 2018-03-25 23:55:38 +09:00
Hajime Hoshi
c767c0631e restorable: Remove unneeded mutex 2018-03-25 23:40:39 +09:00
Hajime Hoshi
97ce612785 Refactoring: Don't access restorable package directly from ebiten package 2018-03-25 23:37:32 +09:00
Hajime Hoshi
ce8b9283a1 Re^2-land: shareable: Implement extending shareable texture again 2018-03-25 22:41:15 +09:00
Hajime Hoshi
125e5c4f32 restorable: Bug fix: Image must be protected with locks (#567) 2018-03-25 22:31:51 +09:00
Hajime Hoshi
e2632e358e restorable: Add TestDoubleResolve 2018-03-25 21:09:26 +09:00
Hajime Hoshi
025fd00e6b restorable: Bug fix: Make the image stale when pixels are partly replaced 2018-03-25 20:39:06 +09:00
Hajime Hoshi
fc47d2843a restorable: Add TestRestoreChain2 2018-03-25 19:43:32 +09:00
Hajime Hoshi
c0b1919020 opengl: Refactoring: More similar way to golang.org/x/mobile/app 2018-03-25 18:23:34 +09:00
Hajime Hoshi
c47b549fd1 restorable: Refactoring: Make functions more atomic 2018-03-25 18:21:43 +09:00
Hajime Hoshi
99f72a1b64 restorable: Bug fix: commands must be flushed at At 2018-03-25 01:26:43 +09:00
Hajime Hoshi
8149ace52c restorable: Add TestDispose 2018-03-25 00:50:11 +09:00
Hajime Hoshi
0acf021e03 restorable: Dispose images explicitly when restoring (#567) 2018-03-24 23:27:08 +09:00
Hajime Hoshi
1616373819 restorable: Ensure the given image is not nil at makeStaleIfDependingOn 2018-03-24 21:57:22 +09:00
Hajime Hoshi
b15fb523a8 shareable: Rename variables 2018-03-24 04:27:10 +09:00
Hajime Hoshi
b92bc6f21c Revert "shareable: Implement extending shareable texture again"
This reverts commit b474946619.

Reason: #567
2018-03-24 04:23:00 +09:00
Hajime Hoshi
2110191794 mobile: Accept gomobile build (#249) 2018-03-24 02:52:42 +09:00
Hajime Hoshi
9009b293e5 graphics: Remove type assertion 2018-03-21 16:51:27 +09:00
Hajime Hoshi
23c2fc0134 Revert "graphics: Remove type assertion"
This reverts commit ff331d031a.

Compile error
2018-03-21 16:48:51 +09:00
Hajime Hoshi
ff331d031a graphics: Remove type assertion 2018-03-21 16:45:57 +09:00
Hajime Hoshi
09166a6c42 graphics: Fix shaders cleaner way 2018-03-21 03:36:36 +09:00
Hajime Hoshi
0a5deab0a2 graphics: Reland Bug fix: More strict calculation for the nearest filter (#558)
Better version of bae8f9d874
2018-03-21 02:40:26 +09:00
Hajime Hoshi
b8025d06f8 opengl: Specify texture wrap (CLAMP_TO_EDGE) 2018-03-21 02:27:11 +09:00
Hajime Hoshi
b157f2d6d0 Revert "graphics: Bug fix: More strict calculation for the nearest filter (#558)"
This reverts commit bae8f9d874.

Reason: TravisCI failed
2018-03-20 04:16:37 +09:00
Hajime Hoshi
a40dc5cf22 graphics: Refactoring shader 2018-03-20 04:05:09 +09:00
Hajime Hoshi
bae8f9d874 graphics: Bug fix: More strict calculation for the nearest filter (#558) 2018-03-20 04:05:03 +09:00
Hajime Hoshi
aaa603dd08 Revert "Revert "shareable: Avoid unneeded extending images""
This reverts commit 96b9f09058.

Fixes #561
2018-03-20 02:15:49 +09:00
Hajime Hoshi
3e929de08a shareable: Revert extending images
Fixes #562
2018-03-20 02:14:04 +09:00
Hajime Hoshi
be4e3ab801 restorable: Bug fix: partial ReplacePixels broke the image state (#562) 2018-03-20 02:14:00 +09:00
Hajime Hoshi
9d37221743 restorable: Refactoring 2018-03-19 23:55:06 +09:00
Hajime Hoshi
927a4388b5 graphics: Bug fix: rounding texels is required even on the nearest filter
Fixes #558
2018-03-19 10:37:18 +09:00
Hajime Hoshi
d421648e57 shareable: Bug fix: workaround to fix #562 by disabling extending 2018-03-19 03:26:31 +09:00
Hajime Hoshi
96b9f09058 Revert "shareable: Avoid unneeded extending images"
This reverts commit ce4e00ff79.

Reason: #560
2018-03-19 02:28:17 +09:00
Hajime Hoshi
b5d065151a restorable: Don't flatten vertices until actually needed 2018-03-18 23:54:45 +09:00
Hajime Hoshi
de3a8d8893 restorable: Remove comments 2018-03-18 18:14:11 +09:00
Hajime Hoshi
5ec5cf2450 ui: Add comments 2018-03-17 18:34:20 +09:00
Hajime Hoshi
526fbd3619 ui: Implement SetWindowDecorated and IsWindowDecorated
Fixes #430.
2018-03-17 18:30:55 +09:00
Hajime Hoshi
ce4e00ff79 shareable: Avoid unneeded extending images 2018-03-17 17:41:36 +09:00
Hajime Hoshi
e7925a12bd shareable: Refactoring 2018-03-16 01:21:33 +09:00
Hajime Hoshi
1b0e71765f internal/hooks: Rename Update -> BeforeUpdate 2018-03-15 02:50:10 +09:00
Hajime Hoshi
61d7f1e9b5 affine: Bug fix: (*GeoM).det() was wrong (#547) 2018-03-12 11:11:53 +09:00
Hajime Hoshi
c2872017ab affine: Add GeoM.Invert, IsInvertible (#547) 2018-03-11 19:13:39 +09:00
Hajime Hoshi
efea65ee58 graphics: Bug fix: wrong texels were used (#546) 2018-03-11 04:11:49 +09:00
Hajime Hoshi
b474946619 shareable: Implement extending shareable texture again
Related to #509
2018-03-11 01:36:47 +09:00
Hajime Hoshi
c37dd9d961 packing: Add Extend 2018-03-11 01:13:53 +09:00
Hajime Hoshi
48408cba11 shareable: Bug fix: Protect critical sections 2018-03-11 00:38:49 +09:00
Hajime Hoshi
c411ca492f shareable: Set finalizers 2018-03-11 00:07:32 +09:00
Hajime Hoshi
a2d6ae7eee shareable: Rename ImagePart -> Image 2018-03-11 00:05:06 +09:00
Hajime Hoshi
6c6b25647a shareable: Rename Image -> backend 2018-03-11 00:02:23 +09:00
Hajime Hoshi
df3960a97c Add internal/shareable 2018-03-10 23:59:26 +09:00
Hajime Hoshi
9555e83589 packing: Add IsEmpty tests 2018-03-10 21:27:11 +09:00
Hajime Hoshi
6c9d9dbaff packing: Improve test errors 2018-03-10 21:02:04 +09:00
Hajime Hoshi
1583cd0f7b packing: Enable to specify max size of a page 2018-03-10 20:53:20 +09:00
Hajime Hoshi
9c72671232 Revert "packing: Add Extend"
This reverts commit 1dd32066d2.

Reason: #542
2018-03-09 16:02:57 +09:00
Hajime Hoshi
e977019d2f graphics: Detect maximum texture size for each environment
Fixes #537, #539

See also #541
2018-03-09 11:47:23 +09:00
Hajime Hoshi
0418ce0761 graphics: Refactoring: Remove duplication of checking image size 2018-03-09 11:04:02 +09:00