Hajime Hoshi
d66c552912
internal/graphicscommand: bug fix: 0-sized image was included in dumped internal images
...
Updates #2270
2022-08-31 12:22:36 +09:00
Terra Brown
26a58d20b3
internal/graphicscommand: enable EBITENGINE_INTERNAL_IMAGES_KEY
on browsers ( #2283 )
...
Closes #2270
Co-authored-by: Hajime Hoshi <hajimehoshi@gmail.com>
2022-08-31 03:10:10 +09:00
Hajime Hoshi
63e3c4adea
Revert "internal/graphics: remove FilterScreen and use an original Kage program instead"
...
This reverts these commits
* 3259ef3daf
* 7c55065490
* 5bb70f485e
Reason: iOS crash. Probably we have to prepare a special rendering
pipeline for the final screen.
Closes #2278
2022-08-30 01:56:06 +09:00
Hajime Hoshi
610e9ce14c
gofmt -s -w
2022-08-28 00:04:32 +09:00
Hajime Hoshi
b2f874a244
image/rectangle: read pixels only for necessary parts
...
Closes #2274
2022-08-27 23:23:33 +09:00
Terra Brown
232cadf15a
internal/graphicscommand: browser screenshot/image dump support ( #2269 )
...
Closes #2265
2022-08-27 12:51:30 +09:00
Hajime Hoshi
5bb70f485e
internal/graphics: remove FilterScreen and use an original Kage program instead
...
Updates #2046
2022-08-26 17:41:29 +09:00
Hajime Hoshi
7542bbc29c
internal/graphicscommand: bug fix: test failures
...
Updates #2236
2022-08-08 03:10:50 +09:00
Hajime Hoshi
70f5e84098
internal/graphicsdriver: rename ReplacePixels to WritePixels
...
Updates #2236
2022-08-08 03:05:04 +09:00
Hajime Hoshi
869147eda0
internal/graphicscommand: rename pixelCommand -> readPixelCommand
...
Updates #1995
2022-08-08 01:47:07 +09:00
mattn
2bacecca24
fix typos ( #2227 )
2022-08-03 22:40:39 +09:00
mattn
3cd0daac67
go generate ./... with Go 1.19 ( #2228 )
2022-08-03 20:48:02 +09:00
Hajime Hoshi
afed6a83c6
internal/graphics: change the naming convention: Num -> Count
...
This change also renames ebiten.MaxIndicesNum -> ebiten.MaxIndicesCount.
2022-07-13 02:02:44 +09:00
Hajime Hoshi
a866fe7391
internal/graphicscommand: improve debug command messages for shaders
2022-07-06 19:29:19 +09:00
Hajime Hoshi
8522bfd0bf
internal/graphicscommand: bug fix: replacePixelsCommand should not read pixels
...
Reading pixels, writing pixels, and using the image as a source might
cause a flaky behavior with Metal. Stop reading pixels if possible.
Closes #2180
2022-07-05 23:30:26 +09:00
Hajime Hoshi
7d725f3e58
Revert "internal/graphicscommand: bug fix: using an image just after ReplacePixels might fail on Metal"
...
This reverts commit c31cc4ecff
.
Reason: This didn't fix the issue.
Updates #2154
2022-07-04 11:50:06 +09:00
Hajime Hoshi
c31cc4ecff
internal/graphicscommand: bug fix: using an image just after ReplacePixels might fail on Metal
...
Inserting a dummy rendering command after ReplacePixels and before
DrawTriangles solved the issue. This is a very dirty hack, but
there seems no other better way.
Closes #2154
2022-07-03 15:59:18 +09:00
Hajime Hoshi
afe1a93648
internal/graphicscommand, internal/graphicsdriver/metal: remove unused code
2022-07-03 15:23:52 +09:00
Hajime Hoshi
a9c9e18ff4
internal/graphicscommand: better strings for ColorM
2022-06-30 11:13:02 +09:00
Hajime Hoshi
6398230f84
internal/graphicscommand: add 'screen' info to (*newImageCommand).String()
2022-06-06 11:13:04 +09:00
Hajime Hoshi
31fd736ca5
internal/graphicscommand: refactoring: unify NewScreenFrameBufferImage and NewImage
2022-06-06 09:21:11 +09:00
Hajime Hoshi
6710808cd1
ebiten: compile shaders at NewShader
...
Closes #2035
2022-04-04 02:52:57 +09:00
Hajime Hoshi
02db3bad53
internal/graphicscommand: remove the dependency on a graphics driver from compileShader
...
Updates #2035
2022-04-04 02:09:08 +09:00
Hajime Hoshi
65094c61b1
internal/graphicscommand: reland: merge adjacent commands if the same shader and uniform variables are used
...
Closes #1846
2022-04-03 03:57:49 +09:00
Hajime Hoshi
f75a70dc40
internal/graphicscommand: treat []float32 instead of interface{} for uniform variables
2022-04-03 03:51:52 +09:00
Hajime Hoshi
990228e216
internal/graphicscommand: cache uniform name locations and types
2022-04-03 03:28:11 +09:00
Hajime Hoshi
9f3f9e64cc
internal/graphicscommand: add panic at convertUniforms
2022-04-03 00:39:05 +09:00
Hajime Hoshi
651c5693c6
Revert "internal/graphicscommand: merge adjacent commands if the same shader and uniform variables are used"
...
This reverts commit 425ce27976
.
Reason: test failures
2022-04-03 00:11:15 +09:00
Hajime Hoshi
425ce27976
internal/graphicscommand: merge adjacent commands if the same shader and uniform variables are used
...
Closes #1846
2022-04-02 23:55:14 +09:00
Hajime Hoshi
351ef9fbb7
internal/atlas, internal/graphicsdriver: move the adjusting-pixel logic to atlas
...
Now pixels are adjusted even when the graphics driver doesn't have
high-precision floats, but this should not be problematic. This was
introduced at 9bff33472a
, but the
adjusting way is much different from the current way.
Updates #879
Closes #1820
2022-04-02 05:15:29 +09:00
Hajime Hoshi
34e23f5256
internal/restorable: treat texels instead of pixels
...
Updates #1820
2022-04-02 04:25:27 +09:00
Hajime Hoshi
b53cb2acd6
internal/ui, internal/mipmap, internal/graphicscommand: fix a wrong panic message
2022-04-01 20:12:12 +09:00
Hajime Hoshi
cd57bccbfc
internal/graphicsdriver: let some functions return an error
...
This is a preparation for the DirectX driver.
Updates #1007
2022-03-21 22:23:12 +09:00
Hajime Hoshi
5e973ab419
Revert "internal/graphicscommand: clear the queue regardless of an error"
...
This reverts commit e21636fbb9
.
Reason: Simply this is no longer needed. We gave up testing when an error
occurs in a graphics command queue.
2022-03-21 21:57:59 +09:00
Hajime Hoshi
81b9f91f86
internal/graphicscommand: compile shaders lazily
...
With DirectX, the graphics driver cannot be determined until the
main loop starts, as a transparent window cannot be treated with
DirectX so far. On the other hand, compiling shaders requires a
graphics driver as it requires information about Y directions of
NDCs and framebuffers.
This change delays compiling shaders until the graphics commands
are actually executed in the main loop.
Updates #1007
Updates #2019
2022-03-21 21:09:02 +09:00
Hajime Hoshi
e21636fbb9
internal/graphicscommand: clear the queue regardless of an error
...
There was a potential issue that commands in the queue are never
reset when an error happens and the queue continues to send errors.
This is problematic especially for testings.
This change fixes the issue by Go's defer.
2022-03-21 20:10:03 +09:00
Hajime Hoshi
ad0e0e3e66
internal/graphicscommand: remove an unused member
2022-03-21 19:50:05 +09:00
Hajime Hoshi
5fe6791b5d
internal/graphicscommand: add a new paramter 'mask' to ReplacePixels
2022-03-21 01:11:01 +09:00
Hajime Hoshi
4cbce71b2b
internal/graphicscommand: move the choice of graphics drivers to internal/ui
2022-03-20 02:51:31 +09:00
Hajime Hoshi
3e44a20b22
internal/graphicscommand: swap arguments
2022-03-20 00:09:17 +09:00
Hajime Hoshi
7c2300b352
internal/graphicscommand: reduce the usages of the graphicsDriver function
2022-03-19 23:03:34 +09:00
Hajime Hoshi
7d0f95e9be
internal/graphicsdriver: refactoring: replace Uniform with []float32
...
Closes #2016
2022-03-13 03:42:13 +09:00
Hajime Hoshi
ed22052e5f
internal/graphicscommand: add a comment
2022-02-28 00:15:52 +09:00
Hajime Hoshi
dd8900ea48
internal/graphicsdriver: refactoring: choose the graphics driver at this package
2022-02-27 23:51:19 +09:00
Hajime Hoshi
77f765d483
internal/testing: bug fix: considering the case when Y is inverted
...
Closes #2003
2022-02-27 22:14:32 +09:00
Hajime Hoshi
4ca1220671
internal/graphicscommand: bug fix: compile error, test failures
2022-02-27 20:13:21 +09:00
Hajime Hoshi
b22309a0e5
internal/graphicsdriver: replace Pixels with ReadPixels
...
Now preparing a byte slice is the caller's responsibility.
2022-02-27 20:03:13 +09:00
Hajime Hoshi
8b7273b74a
internal/graphicsdriver/metal: call PresentDrawable only when necessary
2022-02-22 01:37:13 +09:00
Hajime Hoshi
fcd4453e4f
ebiten: remove RunOnMainThread
...
Unfortunately, there are several issues in RunOnMainThread:
* RunOnMainThread cannot be portable: It is impossible to implement this
correctly on mobiles.
* RunOnMainThread doesn't make sense on mobiles: the rendering works on
a different thread (goroutine) on mobiles.
* RunOnMainThread can cause deadlocks very easily.
Until we find a better solution, let's remove this.
Closes #1945
2022-02-14 01:49:42 +09:00
Hajime Hoshi
ce3f83958e
internal/graphicscommand: rename RunOnMainThread -> RunOnRenderingThread
2022-02-14 00:20:49 +09:00