Commit Graph

81 Commits

Author SHA1 Message Date
Hajime Hoshi
5a1109e56a internal/shader: refactoring 2023-07-24 02:06:54 +09:00
Hajime Hoshi
d99da81203 internal/shader: refactoring 2023-07-24 01:49:37 +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
9ffbc51607 internal/shader: remove ConstType usages from canApplyBinaryOp
Updates #2550
2023-07-23 14:55:15 +09:00
Hajime Hoshi
12e60b7273 internal/shader: reduce shaderir.ConstType usages
Updates #2550
2023-07-23 13:08:08 +09:00
Hajime Hoshi
a5af8f3b0b internal/shaderir: remove isUntypedInteger
Updates #2550
2023-07-23 13:04:25 +09:00
guangwu
54e1263565
all: unnecessary use of fmt.Sprintf (#2691)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-07-05 16:36:29 +09:00
Hajime Hoshi
9d2178cf71 internal/shaderir: rename the built-in func to get a texel to __texelAt 2023-04-23 22:57:30 +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
ad7d5a86f9 internal/shader: bug fix: check the type for composite literal
Closes #2348
2023-02-20 23:07:11 +09:00
Hajime Hoshi
e9e5d27d2c internal/shader: bug fix: % operators for integer vecs didn't work
Closes #1911
2022-11-21 01:39:20 +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
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
4ade34bc02 internal/shaderir: bug fix: wrong argument check on pow
Closes #2304
2022-09-05 02:35:48 +09:00
Hajime Hoshi
85d54515cd internal/shader: check types for && and || correctly
Updates #2256
2022-08-19 17:34:03 +09:00
Hajime Hoshi
d6047f3988 internal/shader: add type checks to compare two values
Closes #2187
2022-08-19 17:03:29 +09:00
Hajime Hoshi
f63b87f675 internal/shader: refactoring 2022-08-19 15:24:00 +09:00
Hajime Hoshi
590147acda internal/shader: add type checks for the builtin function texture2D
Note that texture2D is usually not called by users.

Closes #2184
2022-08-19 02:27:40 +09:00
Hajime Hoshi
63eee0600e internal/shader: add type checks for the builtin function transpose
Updates #2184
2022-08-19 01:57:24 +09:00
Hajime Hoshi
7a94cbbd62 internal/shader: add refract
Closes #2255
2022-08-19 01:48:35 +09:00
Hajime Hoshi
13ae8f5872 internal/shader: add type checks for the builtin function faceforward
Updates #2184
2022-08-19 01:48:30 +09:00
Hajime Hoshi
73f12fa704 internal/shader: add type checks for the builtin function smoothstep
Updates #2184
2022-08-19 01:27:01 +09:00
Hajime Hoshi
f3ea274d20 internal/shader: add type checks for the builtin function mix
Updates #2184
2022-08-19 01:19:20 +09:00
Hajime Hoshi
ec851a85f5 internal/shader: add type checks for the builtin function step
Updates #2184
2022-08-19 00:25:04 +09:00
Hajime Hoshi
34cc6405dd internal/shader: add type checks for the builtin function clamp
Updates #2184
2022-08-19 00:14:38 +09:00
Hajime Hoshi
82a9aac689 internal/shader: add type checks for the builtin function cross
Updates #2184
2022-08-18 23:45:01 +09:00
Hajime Hoshi
7af6c99954 internal/shader: add type checks for some builtin functions
Updates #2184
2022-08-18 23:21:25 +09:00
Hajime Hoshi
fb775d806c internal/shader: disallow 'discard' in other functions than the fragment entry point
Closes #2248
2022-08-17 23:39:52 +09:00
Hajime Hoshi
205245b094 internal/shader: implement a new built-in function discard
Closes #1969
2022-08-09 11:31:59 +09:00
mattn
2bacecca24
fix typos (#2227) 2022-08-03 22:40:39 +09:00
Hajime Hoshi
dce34d2306 internal/shader: change the naming convention: Num -> Count 2022-07-13 02:02:48 +09:00
Hajime Hoshi
4afabe34ae internal/shader: optimization: remove unnecessary local variables
Updates #2034
Updates #2188
2022-07-10 19:01:58 +09:00
Hajime Hoshi
c01821ca5c internal/shader: use all functions for vector comparisons
Updates #2186
2022-07-09 02:30:16 +09:00
Hajime Hoshi
87be157b23 internal/shader: refactoring 2022-07-08 01:09:42 +09:00
Hajime Hoshi
a3590cb258 internal/shader: add type checks to bool/int/flaot
Updates #2184
2022-07-08 00:22:55 +09:00
Hajime Hoshi
faa2ad5c6f internal/shader: add type checks for mat2/mat3/mat4
Updates #2184
2022-07-07 23:05:26 +09:00
Hajime Hoshi
f89277fd85 internal/shader: add type checks to vec2/vec3/vec4
Updates #2184
2022-07-07 00:20:02 +09:00
Hajime Hoshi
853d94c3ef internal/shader: implement strict type checks when calling a function
Closes #2032
2022-04-09 00:32:27 +09:00
Hajime Hoshi
aef00a5235 internal/shader: bug fix: wrong type deduction at (scalar)*(matrix)
Updates #2037
2022-03-27 01:22:54 +09:00
Hajime Hoshi
a936ffc032 internal/shader: restrict the number of arguments for atan/atan2 2022-03-26 19:40:04 +09:00
Hajime Hoshi
a617576879 internal/shaderir: replace Mul with ComponentWiseMul and MatrixMul
This is a preparation for DirectX / HLSL.

Updates #1007
2022-03-13 19:17:46 +09:00
Hajime Hoshi
5614e9d7eb internal/shader: fix misspellings 2022-03-10 02:52:44 +09:00
Hajime Hoshi
880dd0682e internal/shader: bug fix: fix some failing tests 2022-03-10 02:24:29 +09:00
Hajime Hoshi
de05ede27e internal/shader: bug fix: evaluate the builtin float/int functions in the pre-compile phase correctly
Closes #2011
2022-03-10 00:47:16 +09:00
Hajime Hoshi
84c680c6ed internal/shader: ban the operator div on a matrix
The operator div on a matrix doesn't work on Metal.
2022-01-21 03:37:34 +09:00
Hajime Hoshi
2e5b4954f3 internal/shader: bug fix: forbid mat + float
mat + float doesn't work on Metal.
2022-01-21 02:42:22 +09:00
Hajime Hoshi
8d2bf6525c internal/shader: bug fix: wrong type checkings for operator *
Updates #1971
2022-01-21 01:06:02 +09:00
Hajime Hoshi
260f7e07df internal/shader: bug fix: deduction checks for the % operator were lacked 2022-01-14 03:51:04 +09:00