Commit Graph

2268 Commits

Author SHA1 Message Date
Hajime Hoshi
b00666df22 shader: Refactoring: Split files 2020-07-04 23:47:23 +09:00
Hajime Hoshi
49b389c8b1 shader: Add tests for invalid binary expressions 2020-07-04 20:23:37 +09:00
Hajime Hoshi
f362455387 shader: Bug fix: correct type deduction from 'mat2*vec2'
Fixes #1236
2020-07-04 20:08:01 +09:00
Hajime Hoshi
6c33ed107f affine: Add more tests for (*ColorM).Invert 2020-07-04 01:58:37 +09:00
Hajime Hoshi
2e8e35750d affine: Refactoring 2020-07-04 01:36:48 +09:00
Gabriel Ochsenhofer
94b5747806
affine: Add functions to invert ColorM (#1233)
Fixes #548
2020-07-04 01:23:47 +09:00
Hajime Hoshi
d08f57e610 uidriver/glfw: Bug fix: Skip some special 'joysticks'
Apparently, there are some special devices that are recognized as
joysticks by GLFW, even though they are not. Such devices can have
too many 'buttons'. Skip them as a tentative solution.

Updates #1173
2020-07-03 22:58:49 +09:00
Hajime Hoshi
b7a1e85788 uidriver/glfw: Remove unused logics 2020-07-03 22:24:30 +09:00
Hajime Hoshi
02ef92f4cd ebiten: Remove copying pixels from ReplacePixels and copyImage (renamed to imageToBytes)
This optimization utilizes the fact that copying happens in the
'shareable' package to add paddings.

Updates #1222
2020-07-03 03:01:48 +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
4c640d2500 buffered, restorable: Remove copying pixels
Instead, the callers (ebiten.NewImageFromImage and
(*ebiten.Image).ReplacePixels) have responsibility to copy the
pixels now. This change should reduce unnecessary copying pixels.

Updates #1222
2020-07-01 02:56:40 +09:00
Hajime Hoshi
f636cdf5f7 testing: Bug fix: Wrong uniform variables 2020-06-30 01:49:40 +09:00
Hajime Hoshi
8c5f8c03b7 buffered: Refactoring 2020-06-30 01:16:50 +09:00
Hajime Hoshi
999b726b72 shareable: Bug fix: The first image's region in the uniform vriables was ignored 2020-06-30 00:50:40 +09:00
Hajime Hoshi
1fe2f47701 graphicscommand: Remove the source-region parts from the uniform variables 2020-06-30 00:44:05 +09:00
Hajime Hoshi
780465b702 ebitenutil: Cache ColorM and reuse them at DrawRect
Fixes #1221
2020-06-29 22:35:28 +09:00
Hajime Hoshi
09322dfdc8 buffered: Avoid creating func objects whenever possible
Fixes #1220
2020-06-29 21:50:32 +09:00
Hajime Hoshi
dea3785750 shareable, restorable, graphicscommand: Remove making arrays at DrawTriangles
Updates #1220
2020-06-29 13:37:37 +09:00
Hajime Hoshi
ebd0e11c0d graphicsdriver/metal: Avoid synching texture data at ReplacePixels
Instead, use a temporary texture, transfer texture data to it, and
copy the data on GPU side.
2020-06-28 19:40:37 +09:00
Hajime Hoshi
383ff1e6a7 shareable: Use as big backends as possible
As the shader hack is removed at d74f7d3a77,
any sizes of textures should work regardless of the float precision.
2020-06-28 04:14:55 +09:00
Hajime Hoshi
aea4630b5f Revert "buffered: Defer ReplacePixels when possible"
This reverts commit 1395ab5e84.

Reason: This increases the number of ReplacePixels aggressively.
2020-06-28 02:49:55 +09:00
Hajime Hoshi
36515eb1f5 Revert "ebiten: Make ebiten.Image and buffered.Image 1:1"
This reverts commit 620981a09a.

Fixes #1218
Updates #896
2020-06-28 01:01:39 +09:00
Hajime Hoshi
7e01ba17c1 shareable: Bug fix: wrong size calculation
The size calculation must consider the paddings.

Fixes #1217
2020-06-27 17:21:26 +09:00
Hajime Hoshi
00e8b701c1 graphicsdriver/metal: Optimization 2020-06-27 04:14:21 +09:00
Hajime Hoshi
2bc1475a15 graphicsdriver/metal: Bug fix: Sync textures before replacing a region
Updates #1213
2020-06-27 03:08:17 +09:00
Hajime Hoshi
7b6182d05a shareable: Update comments 2020-06-27 02:46:29 +09:00
Hajime Hoshi
5a176d6f4f graphicsdriver/metal: Bug fix: synchronizing must be skipped on iOS 2020-06-27 01:45:14 +09:00
Hajime Hoshi
9f76b96c1f graphicsdriver/metal: Specify the texture type explicitly 2020-06-26 23:46:12 +09:00
Hajime Hoshi
a1abe6b728 restorable: Add padding when renderingn the empty image 2020-06-26 14:01:49 +09:00
Hajime Hoshi
198621404f buffered: Bug fix: Pixel data was not invalidated after DrawImage/Triangles 2020-06-25 13:11:19 +09:00
Hajime Hoshi
4a7929cf71 buffered: Bug fix: Duplicated calls of resolvePendingPixels 2020-06-25 04:08:24 +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
545342262f examples/shader: Show an image 2020-06-24 01:41:27 +09:00
Hajime Hoshi
f10263fff7 shader: Bug fix: Test failures 2020-06-21 22:32:54 +09:00
Hajime Hoshi
c36d2165e6 shader: Parse number literals in unary expressions correctly
Fixes #1190
2020-06-21 21:47:27 +09:00
Hajime Hoshi
29b70bea95 shader: Parse number literals in binary expressions correctly
Updates #1190
2020-06-21 21:32:40 +09:00
Hajime Hoshi
afc39a100c shader: Reduce the calls of parseExpr so that unneeded variables are reduced 2020-06-21 16:39:26 +09:00
Hajime Hoshi
ac9bb92885 shader: Refactoring: Reduce calls of parseExpr at definings 2020-06-21 05:26:23 +09:00
Hajime Hoshi
40e581c19f shader: Allow to mix an int and a float in a binary expression
Updates #1190
2020-06-21 03:34:55 +09:00
Hajime Hoshi
eb136daa39 testing: Bug fix: Compile error 2020-06-21 02:26:59 +09:00
Hajime Hoshi
ea9fae1faa shader: Abort parsing correctly when an error is found 2020-06-21 02:18:21 +09:00
Hajime Hoshi
912135d1e7 shaderir: Use constant.Value for number literals
Updates #1190
2020-06-21 01:30:23 +09:00
Hajime Hoshi
4b5de9f445 shaderir: Refactoring: Add OpFromToken 2020-06-20 23:27:54 +09:00
Hajime Hoshi
28948a9976 shaderir: Add (*Type).serialize again 2020-06-20 21:08:08 +09:00
Hajime Hoshi
255da0367f shader: Bug fix: a binary expression for an int and a float did not work 2020-06-20 18:10:23 +09:00
Hajime Hoshi
5e0e12d290 shader: Bug fix: Resolve types in a binary expression correctly 2020-06-20 17:49:23 +09:00