Commit Graph

72 Commits

Author SHA1 Message Date
Hajime Hoshi
927e025982 internal/shader: bug fix: wrong type conversion for min, max, and clamp
Closes #2922
2024-03-10 11:30:06 +09:00
Hajime Hoshi
cc3db584f2 internal/shader: allow integer types for clamp
Closes #2788
2024-02-25 21:21:27 +09:00
Hajime Hoshi
4b9508c523 internal/shader: bug fix: wrong type checks on min/max
Updates #2788
2024-02-25 21:17:54 +09:00
Hajime Hoshi
e8cdf885c0 internal/shader: allow integer types for min and max
Updates #2788
2024-02-25 20:18:19 +09:00
Hajime Hoshi
face5fd870 internal/shader: allow integer types for abs and sign
Updates #2788
2024-02-25 18:16:44 +09:00
Hajime Hoshi
820c996329 internal/shader: bug fix: wrong lhs in an assignment
Closes #2910
2024-02-15 02:29:21 +09:00
Hajime Hoshi
fca8ebb9af internal/shader: bug fix: non-name on the left side of :=
Closes #2891
2024-02-11 21:21:16 +09:00
Hajime Hoshi
75103f39dd internal/shader: bug fix: error on a function name in a function call
Updates #2891
2024-02-11 21:09:49 +09:00
Hajime Hoshi
9b9384baa0 internal/shader: bug fix: variables in an index should be marked as used
Closes #2848
2023-11-19 14:50:43 +09:00
Hajime Hoshi
b95228a8a6 all: rename arguments in Kage
Closes #2767
2023-09-24 16:46:36 +09:00
Hajime Hoshi
0e27a8a30b internal/shader: bug fix: spaces around a compiler directive should be allowed
Closes #2771
2023-09-22 01:45:11 +09:00
Hajime Hoshi
0e19cd10be internal/shader: add type checks for a bitwise operator + assignment
Closes #2754
2023-09-13 04:17:46 +09:00
Hajime Hoshi
1f67518319 internal/shader: clean up tests 2023-09-13 03:57:20 +09:00
Hajime Hoshi
c13980158f internal/shader: add type checks for bitwise operators
Updates #2754
2023-09-12 02:40:42 +09:00
Hajime Hoshi
20ddfba983 internal/shader: bug fix: error in assinments to multiple variables
Closes #2747
2023-09-04 02:21:45 +09:00
Hajime Hoshi
1269315f75 internal/shader: bug fix: forbid duplicated uniform variables
Closes #2648
2023-08-29 00:43:10 +09:00
Hajime Hoshi
2de54c556b internal/shader: bug fix: wrong for-loop should fail compilation
Closes #2680
2023-08-08 23:38:01 +09:00
Hajime Hoshi
d8630f940d internal/shader: bug fix: forbide comparing non-scalar values
Closes #2718
2023-08-01 12:32:16 +09:00
Hajime Hoshi
63df6168d9 internal/shader: use plural forms for Kage compiler directives
This change renames

```
//kage:unit texel
//kage:unit pixel
```

to

```
//kage:unit texels
//kage:unit pixels
```

.

Closes #2717
2023-08-01 11:41:38 +09:00
Hajime Hoshi
4df647a400 internal/shader: bug fix: forbid to have an initial value for uniform variables
Closes #2711
2023-07-29 20:51:02 +09:00
Hajime Hoshi
900b687f40 internal/shader: add tests
Updates #2712
2023-07-28 01:59:31 +09:00
Hajime Hoshi
88be4c5b7c internal/shader: reland: bug fix: stricter type checks for the built-in cast-like functions
Closes #2712
2023-07-28 01:33:27 +09:00
Hajime Hoshi
be2123f7fd Revert "internal/shader: bug fix: stricter type checks for the built-in functions"
This reverts commit 287545b02a.

Reason: test failures

Updates #2712
2023-07-28 00:54:36 +09:00
Hajime Hoshi
287545b02a internal/shader: bug fix: stricter type checks for the built-in functions
Closes #2712
2023-07-28 00:51:42 +09:00
Hajime Hoshi
ef08873f30 internal/shader: reland2: bug fix: int + ivec failed
Closes #2707
2023-07-26 01:23:02 +09:00
Hajime Hoshi
8aefa49510 Revert "internal/shader: reland: bug fix: int + ivec failed"
This reverts commit 1c4a0ac0dc.

Reason: TestShaderUniformMatrix2 failed on Windows

Updates #2707
2023-07-26 00:30:17 +09:00
Hajime Hoshi
1c4a0ac0dc internal/shader: reland: bug fix: int + ivec failed
Closes #2707
2023-07-25 23:02:06 +09:00
Hajime Hoshi
3d8d759976 Revert "internal/shader: bug fix: int + ivec failed"
This reverts commit a93908503a.

Reason: test failures at TestShaderUniformMatrix2

Updates #2070
2023-07-25 22:53:02 +09:00
Hajime Hoshi
a93908503a internal/shader: bug fix: int + ivec failed
Closes #2707
2023-07-25 22:42:06 +09:00
Hajime Hoshi
b743b7ab50 internal/shader: bug fix: return true for float must fail
Closes #2706
2023-07-25 02:51:18 +09:00
Hajime Hoshi
20123e8420 internal/shader: bug fix: unary operators should keep the type info
Closes #2705
2023-07-24 02:21:42 +09:00
Hajime Hoshi
0657e67cef internal/shader: add more tests for % op 2023-07-24 02:00:00 +09:00
Hajime Hoshi
a8c3eb7167 internal/shader: bug fix: don't allow a binary op with different typed constants
Closes #2704
2023-07-24 01:41:22 +09:00
Hajime Hoshi
1035b1d182 internal/shader: bug fix: wrong issue number
Updates #2590
Updates #2648
2023-05-09 01:40:33 +09:00
Hajime Hoshi
ad23ae81c1 internal/shader: bug fix: forbide assigning to a uniform variable
Closes #2648
2023-05-09 01:38:41 +09:00
Hajime Hoshi
2a1d23d926 internal/shader: bug fix: panic when an assignment mismatch happens
Closes #2654
2023-04-26 22:09:25 +09:00
Hajime Hoshi
49582519c1 all: add a compiler directive kage:unit
This change adds a new compiler directive 'kage:unit' to Kage. This
takes one of these two values: 'pixel' and 'texel'. The default value
is 'texel'.

With the pixel-unit mode, all the built-in functions treats pixels
instead of texels, and the texCoord argument of Fragment is in pixels.
This simplifies shader programs as programs no longer have the notion
of texels.

With the texel-unit mode, the behavior is the same as the current
behavior.

Closes #1431
2023-04-23 22:11:57 +09:00
Hajime Hoshi
b5ca404c42 internal/shader: bug fix: a swizzling 'r' didn't work for vec2
Closes #2652
2023-04-23 21:29:20 +09:00
Hajime Hoshi
df32901dce internal/shader: refactoring 2023-04-16 18:37:06 +09:00
Hajime Hoshi
ad7d5a86f9 internal/shader: bug fix: check the type for composite literal
Closes #2348
2023-02-20 23:07:11 +09:00
Pierre Curto
4de807cc44
all: fix typos (#2558)
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
2023-01-28 19:06:38 +09:00
Hajime Hoshi
06bc569b73 internal/shader: bug fix: wrongly typed constants were unexpectedly used
Closes #2549
2023-01-20 02:26:39 +09:00
Hajime Hoshi
f129c23393 all: update URLs in comments 2022-11-21 01:46:50 +09:00
Hajime Hoshi
0b9cbaa1ed internal/shader: introduce integer vectors (ivec2, ivec3, ivec4)
Closes #1911
2022-11-21 00:31:23 +09:00
Hajime Hoshi
5aecd6762c internal/shader: refactoring 2022-11-20 18:25:08 +09:00
Hajime Hoshi
dc1df824a5 internal/shader: more strict type checks with built-in functions 2022-11-20 17:47:53 +09:00
Hajime Hoshi
5d8216def3 internal/shader: stricter const type check 2022-11-20 15:52:33 +09:00
Hajime Hoshi
5f4e3a0348 internal/shader: add swizzling check 2022-11-19 22:39:17 +09:00
Hajime Hoshi
1703297f37 internal/shader: add a test for type shadowing 2022-09-24 19:00:23 +09:00
Hajime Hoshi
7f91a681e3 internal/shader: check type redeclaration 2022-09-24 18:56:01 +09:00