Commit Graph

2516 Commits

Author SHA1 Message Date
Hajime Hoshi
4d3d3134d5 shader: Bug fix: Checking unused variables defined with var 2020-09-17 17:29:37 +09:00
Hajime Hoshi
ded223ead0 shader: Bug fix: selector is not available on a blank identifier 2020-09-14 03:41:25 +09:00
Hajime Hoshi
e1d8629189 shader: Bug fix: a blank identifier lhs and += cannot work 2020-09-14 00:51:27 +09:00
Hajime Hoshi
fd51abfb0d shader: Bug fix ++/-- must not be applied to a blank identifier 2020-09-14 00:32:47 +09:00
Hajime Hoshi
7666987b09 shader: Bug fix: a blank identifier cannot be used as values 2020-09-13 23:55:25 +09:00
Hajime Hoshi
154f86e6c1 shader: Check unused local variables
Fixes #1328
2020-09-13 22:36:41 +09:00
Hajime Hoshi
e543d4f107 shader: Bug fix: true/false should be available as a local variable 2020-09-13 20:38:51 +09:00
Hajime Hoshi
a5af597594 shader: Forbid assigning to special variables 2020-09-13 05:19:20 +09:00
Hajime Hoshi
ed4a7e1856 shader: Forbid init functions
Fixes #1331
2020-09-12 19:50:23 +09:00
Hajime Hoshi
de4ff71544 devicescale: Read ~/.config/cinnamon-monitors.xml on Cinnamon
Updates #1307
2020-09-12 19:15:11 +09:00
Hajime Hoshi
8833e46c7e shader: Refactoring 2020-09-12 18:54:36 +09:00
Hajime Hoshi
a0db26f234 ebiten: Bug fix: Test failuer (TestShaderWrongReturn) 2020-09-12 18:36:22 +09:00
Hajime Hoshi
d001f49ad7 shader: Bug fix: Treat multiple-context at return correctly 2020-09-12 17:44:04 +09:00
Hajime Hoshi
2fb1033183 shader: Initialize output parameters explicitly 2020-09-12 00:35:14 +09:00
Hajime Hoshi
99dcb14582 shaderir/glsl: Refactoring 2020-09-10 02:11:21 +09:00
Hajime Hoshi
e1ae9bdde0 shaderir/glsl, shaderir/metal: Refactoring 2020-09-10 02:04:28 +09:00
Hajime Hoshi
337f44c916 shader: Add Metal tests
Fixes #1340
2020-09-10 01:19:02 +09:00
Hajime Hoshi
031f8376e9 shaderir: Refactoring 2020-09-08 03:51:29 +09:00
Hajime Hoshi
3b040e5f22 Fix test failures 2020-09-08 03:10:59 +09:00
Hajime Hoshi
1786be55f7 shader: Refactoring 2020-09-08 02:43:41 +09:00
Hajime Hoshi
0a0401e217 shader: Refactoring: Simplify calculation of LocalVarIndexOffset 2020-09-08 02:42:43 +09:00
Hajime Hoshi
41d4fc288b shader: Reword 2020-09-08 01:40:49 +09:00
Hajime Hoshi
f61a916e4a shaderir/glsl: Bug fix: Calculate local variable indices correctly
Fixes #1339
2020-09-08 00:19:07 +09:00
Hajime Hoshi
4308bbbc31 shader: Check the existence of 'return' 2020-09-06 22:33:27 +09:00
Hajime Hoshi
e0b8b9945f shader: Check returning value types and the number 2020-09-06 22:08: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
20ccafce4b uidriver/mobile: Bug fix: Freezing on Pixel 4a by force calling DoWork
When the two channels don't receive for a while, call DoWork forcibly to avoid
freeze.

In theory, this timeout should not be necessary. However, it looks like this
'select' statement sometimes blocks forever on some Android devices like
Pixel 4(a). Apparently workAvailable sometimes not receives even though there
are queued OpenGL functions. Call DoWork for such case as a symptomatic
treatment.

Calling DoWork without waiting for workAvailable is safe. If there are no tasks,
DoWork should return immediately.

Updates #1322
Fixes #1332
2020-09-06 14:34:12 +09:00
Hajime Hoshi
29c7b7687f shaderir: Add Program.UniformNames
Updates #1324
2020-09-06 03:41:17 +09:00
Hajime Hoshi
ac30377297 graphicscommand: Bug fix: Adjusting source regions must be done before checking merging
Fixes #1333
2020-09-05 00:42:51 +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
760225df75 glfw: Replace the pointer size calc with bits.UintSize / 8
Updates #1306
2020-09-04 01:18:42 +09:00
Hajime Hoshi
ee15e06c50 glfw: Remove some suspicious codes depending on the memory layout 2020-09-04 01:10:39 +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
55f0c983ba shader: Bug fix: Ignore blank identifiers for the duplication check
Fixes #1330
2020-09-03 03:03:06 +09:00
Hajime Hoshi
4ac11bf156 shader: Bug fix: Treat number literals in function calls correctly 2020-09-03 02:45:22 +09:00
Hajime Hoshi
0b1d29b6e7 shader: Bug fix: Returning value's integer literals were wrong 2020-09-03 02:10:52 +09:00
Hajime Hoshi
f5829b2cf3 shader: Check at least one variable on left side of :=
Updates #1330
2020-09-03 01:15:41 +09:00
Hajime Hoshi
8336cb6007 uidriver/mobile: Refactoring 2020-08-31 23:28:00 +09:00
Hajime Hoshi
f332fa61c1 uidriver/mobile: Refactoring 2020-08-31 01:01:36 +09:00
Hajime Hoshi
8c779447db shader: Friendly error messages when local variable names are duplicated
Fixes #1254
2020-08-30 21:22:10 +09:00
Hajime Hoshi
349faa0f34 thread: Use an error value instead of context.Context 2020-08-30 02:18:12 +09:00
Hajime Hoshi
1ed2b09ba0 uidriver/glfw: Ensure that canceling happens after all the queued tasks are done 2020-08-29 23:27:20 +09:00
Hajime Hoshi
deb3d4a0c3 uidriver/mobile: Bug fix: Freeze on Pixel 4
An Ebiten application often freezes on Pixel 4. Apparently adding
loggings or runtime.Gosched hides the issue, though this doesn't fix
the root cause. The root cause might be in gomobile itself, but it
seeems really hard to make a minimum case.

As a tentative fix, add runtime.Gosched to avoid freezing.

Fixes #1322
2020-08-29 22:02:54 +09:00
Hajime Hoshi
e19f38bd4f uidriver/mobile: Refactoring 2020-08-29 03:02:20 +09:00
Hajime Hoshi
12878571f6 uidriver/mobile: Refactoring 2020-08-29 02:48:06 +09:00
Hajime Hoshi
b76c34336d uidriver/mobile: Reduce mutex usages 2020-08-29 00:24:30 +09:00
Hajime Hoshi
91aa6a0f3a mobile/ebitenmobileview: Remove mutex usages 2020-08-29 00:18:42 +09:00
Hajime Hoshi
0f21829867 shareable: Bug fix: Add the padding to the offsets when there are no sources
Fixes #1320
2020-08-27 03:42:23 +09:00
Hajime Hoshi
12e5617396 uidriver/glfw: Update comments 2020-08-24 04:07:08 +09:00
Hajime Hoshi
932d599c98 uidriver/glfw: Bug fix compilation failure on macOS and Windows 2020-08-24 03:31:46 +09:00
Hajime Hoshi
a7d234e3c8 uidriver/glfw: Refactoring: make currentMonitorByOS more explicit 2020-08-24 03:27:38 +09:00
Hajime Hoshi
9bff1c79be uidriver/glfw: Refactoring 2020-08-24 03:05:38 +09:00
Hajime Hoshi
af6961fc17 uidriver/glfw: Bug fix: isInitWindowMaximized didn't unlock the mutex 2020-08-24 02:55:31 +09:00
Hajime Hoshi
b1bc06935a uidriver/glfw: Update comments 2020-08-24 00:57:48 +09:00
Hajime Hoshi
ed3a4a734e uidriver/glfw: Refactoring 2020-08-24 00:34:57 +09:00
Hajime Hoshi
9f8054c2d5 uidriver/glfw: Misspelling 2020-08-24 00:10:43 +09:00
Hajime Hoshi
07480ed66d uidriver/glfw: Add better fallbacks for currentMonitorFromPosition
Updates #1119
2020-08-23 23:38:03 +09:00
Hajime Hoshi
10d6a3ad67 uidriver/glfw: Bug fix: Crash on Wine when getting a monitor 2020-08-23 02:31:52 +09:00
Hajime Hoshi
77fa0cb9ef ui: Add SetInitFocused
Fixes #769
2020-08-23 02:19:09 +09:00
Hajime Hoshi
dea716c9a6 uidriver: Remove force focusing by clicking the body
As long as the game is embedded in an iframe, this is no longer
needed.
2020-08-22 18:40:34 +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
85d172c673 uidriver/mobile: Bug fix: The context didn't recovered on gomobile-build
Updates #1176
2020-08-19 23:59:27 +09:00
Hajime Hoshi
7329880f40 restorable: Make the image stale when volatile state changes 2020-08-19 21:13:05 +09:00
Hajime Hoshi
8aef1f9080 restorable: Enable to set the 'volatile' state later
Updates #1309
2020-08-19 00:57:23 +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
64a6b39240 Revert "restorable: Do not record pixels if restoring is not requried"
This reverts commit 5e1f263d6d.

Reason: Issue #1304
2020-08-17 00:00:12 +09:00
Hajime Hoshi
5e1f263d6d restorable: Do not record pixels if restoring is not requried
Fixes #1022
2020-08-16 20:07:17 +09:00
Hajime Hoshi
a9b94a183b shader: Implement swapping variables
Fixes #1248
2020-08-16 18:40:45 +09:00
Hajime Hoshi
06ed4f5444 shader: Implement len function
Fixes #1279
2020-08-16 02:07:39 +09:00
Hajime Hoshi
a67fd4a2b3 mipmap: Bug fix: Adopt 32 for tooBigScale
I found the case that 64 was not enough on Huawei ALE-L02.
2020-08-15 15:39:27 +09:00
Hajime Hoshi
71e65fa1b7 cmd/ebitenmobile: Use an explict way to detect context lost on Android
Fixes #1176
2020-08-15 01:39:08 +09:00
Hajime Hoshi
d48770cb1c png: Update for Go 1.15 2020-08-14 03:25:02 +09:00
Hajime Hoshi
7307a148f5 glfw: Use Dockerfile for ease to generate the embedding files for Windows
As MinGW version is specified, the result should be more deterministic.

Fixes #1201
2020-08-14 01:34:58 +09:00
Hajime Hoshi
d73472f4f2 Use the library style of file2byteslice 2020-08-14 00:50:09 +09:00
Hajime Hoshi
f6c3e0579f shaderir: Adopt the precision 10 for float literals
Adopted the same precision of (*math/big.Float).String().
2020-08-13 00:01:16 +09:00
Hajime Hoshi
50cd33ed9b shader: Bug fix: Use integer literals in the integer context
Fixes #1299
2020-08-12 13:47:22 +09:00
Hajime Hoshi
39d829d3bf shader: Check the index is an exact integer 2020-08-12 13:47:22 +09:00
Hajime Hoshi
18732ca879 shader: Bug fix: Wrong type deduction with int(x)
Fixes #1298
2020-08-12 12:16:22 +09:00
Hajime Hoshi
d4042a5cfa ebiten: Bug fix: Source regions should not be passed when not needed
The source region information affects the condition of merging
graphics commands. To avoid performance issues by the big number of
graphcis commands, do not pass the source region whenever possible.

Fixes #1293
2020-08-12 02:12:35 +09:00
Hajime Hoshi
08270ee729 shader: Enable to parse ... in an array type 2020-08-11 23:51:22 +09:00
Hajime Hoshi
f71346da6c shaderir: Add bool/int/float conversion
Updates #1289
2020-08-11 23:04:55 +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
523dc6f2a0 graphicscommand: Add comments 2020-08-11 03:17:50 +09:00
Hajime Hoshi
985ff2d43f graphicscommand: 0th image must be adopted to calculate the size 2020-08-11 01:38:00 +09:00
Hajime Hoshi
ee049a19ac shader: Bug fix: Wrong local variable index in a block in the fragment entry point 2020-08-10 02:29:49 +09:00
Hajime Hoshi
9b6b306ca3 shader: Bug fix: Wrong local variable index in a block in an entry point 2020-08-10 02:22:09 +09:00
Hajime Hoshi
4d20da9bc0 shader: Refactoring 2020-08-10 02:02:26 +09:00
Hajime Hoshi
e534fe8246 shader: Add more tests using a for-loop 2020-08-10 01:14:42 +09:00
Hajime Hoshi
5d2606b6a5 shader: Bug fix: Wrong local variable indices in blocks 2020-08-10 01:09:02 +09:00
Hajime Hoshi
240e20ad87 shader: Bug fix: Wrong variable index at declaration 2020-08-09 23:23:40 +09:00
Hajime Hoshi
a0494210c3 shader: Bug fix: Wrong local variable index in a block 2020-08-09 23:14:28 +09:00
Hajime Hoshi
eacc9fac6a shader: Indexing with non-consntat value should be allowed 2020-08-09 22:50:53 +09:00
Hajime Hoshi
5dc0d4e1a4 shader: Add more tests about 'for' loops 2020-08-09 22:26:57 +09:00
Hajime Hoshi
dee8690502 shaderir/glsl: Bug fix: Copying an array did not work on GLSL
Fixes #1286
2020-08-09 22:18:58 +09:00
Hajime Hoshi
646518f2e8 shaderir: Fix the test side: local variables for 'for' stmts must be reserved 2020-08-09 22:12:35 +09:00
Hajime Hoshi
b73fecae79 shaderir: Add tests for different counter types 2020-08-09 21:44:06 +09:00
Hajime Hoshi
2707915376 shaderir/glsl, shaderir/metal: Bug fix: Wrong local variables with multiple 'for' statements 2020-08-09 20:12:56 +09:00
Hajime Hoshi
80361443cc shaderir/glsl, shaderir/metal: Bug fix: Wrong local variables in for 2020-08-09 20:06:13 +09:00