Commit Graph

65 Commits

Author SHA1 Message Date
Hajime Hoshi
385ff8efdf shader: Bug fix: Wrong local variable names at for-loop
Fixes #1245
2020-07-13 22:49:15 +09:00
Hajime Hoshi
2ca551cdc6 shader: Implement 'for' statement
Fixes #1230
2020-07-13 01:44:05 +09:00
Hajime Hoshi
f95ca46c99 shaderir: Add Stmt.ForVarType and use constant.Value
Updates #1230
2020-07-12 22:31:12 +09:00
Hajime Hoshi
291d69500b shaderir: Add Stmt.ForVarIndex
Updates #1230
2020-07-12 21:55:07 +09:00
Hajime Hoshi
202bb34bac shaderir: Add builtin funcs dfdx, dfdy, fwidth
Fixes #1242
2020-07-11 21:50:10 +09:00
Hajime Hoshi
aecd29325e shaderir: Bug fix: Wrong function names for some bulitin funcs 2020-07-11 21:46:21 +09:00
Hajime Hoshi
776de77744 shaderir: Remove and rename some builtin functions
Apparently matrixCompMult and outerProduct are not portable.

We adopted the naming rule foobar instead of fooBar.
2020-07-11 21:43:24 +09:00
Hajime Hoshi
4021c24534 shader: Separate uniform variables and texture variabls
Textures cannot be treated as a regular variable, then they should
be treated differently from other uniform variables.

Add a new function texture0At replacing texture2D.

Updates #1239
2020-07-08 01:12:07 +09:00
Hajime Hoshi
98ae0826c7 shaderir: Bug fix: Early-returns in the entry points didn't work
Fixes #1238
2020-07-05 17:57:57 +09:00
Hajime Hoshi
380b7382ac shader: Add 'if'
Updates #1230
2020-07-05 02:33:49 +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
afb4e6dc3d shaderir: Misspelling 2020-06-18 01:28:17 +09:00
Hajime Hoshi
2869885816 shaderir: Fix the initial variable values on GLSL
This is for consistency with number literals we are introducing.

Updates #1190
2020-06-17 01:59:02 +09:00
Hajime Hoshi
f39c591252 shader: Enable more Go syntax 2020-06-11 01:13:03 +09:00
Hajime Hoshi
399bb93044 shaderir: Add space lines between functions 2020-06-08 01:41:47 +09:00
Hajime Hoshi
9a5481459a shaderir: Remove inout params 2020-06-07 19:24:27 +09:00
Hajime Hoshi
39c09a4f88 shaderir: Change the param order of fragment shaders 2020-06-03 02:01:50 +09:00
Hajime Hoshi
cd3d396975 shader: Implement vertex shader entry point 2020-06-03 01:03:27 +09:00
Hajime Hoshi
fa5b2ed730 shaderir: Change the param order 2020-06-03 00:46:52 +09:00
Hajime Hoshi
3118657fff shaderir: Fix integer literals 2020-06-02 21:45:33 +09:00
Hajime Hoshi
6fa7b4bb5a shader: Analyze blocks and shadowings 2020-06-01 00:58:33 +09:00
Hajime Hoshi
afd114e606 shader: Parse function bodies 2020-05-31 19:03:33 +09:00
Hajime Hoshi
1042eb71e0 shaderir: Rename Sampler2D -> Texture2D 2020-05-30 17:48:56 +09:00
Hajime Hoshi
8738d182fb restoreble: Add test with shaders rendering an image
Updates #1168
2020-05-25 02:32:23 +09:00
Hajime Hoshi
3ed9f8ee3b shaderir: Update comments 2020-05-24 02:07:57 +09:00
Hajime Hoshi
14e90a34aa shaderir: Add more builtin functions 2020-05-23 22:01:10 +09:00
Hajime Hoshi
f38ca35608 shaderir: Remove attribute variables from fragment shaders 2020-05-23 19:06:44 +09:00
Hajime Hoshi
125f85effe shaaderir: Use gl_FragColor 2020-05-23 18:18:22 +09:00
Hajime Hoshi
da4d5b1338 shaderir: Add more builtin functions 2020-05-23 18:07:32 +09:00
Hajime Hoshi
7937b302e3 shaderir: Do not use () for the callees 2020-05-23 18:06:50 +09:00
Hajime Hoshi
a338c7180c shaderir: Split vertex shader and fragment shader at Glsl() 2020-05-21 23:58:08 +09:00
Hajime Hoshi
29dbad28f9 shaderir: Add new lines 2020-05-17 17:06:21 +09:00
Hajime Hoshi
156ed320cc shaderir: Remove Variable and VariableType 2020-05-17 04:28:03 +09:00
Hajime Hoshi
094d845edd shaderir: Remove Ident 2020-05-17 03:00:57 +09:00
Hajime Hoshi
dbbe4ee09c shaderir: Add StructMember 2020-05-17 02:46:02 +09:00
Hajime Hoshi
8a6140a92f shaderir: Refactoring 2020-05-17 02:45:03 +09:00
Hajime Hoshi
e1d0800f19 shaderir: Bug fix: Wrong implementation of isValidSwizzling 2020-05-17 02:25:37 +09:00
Hajime Hoshi
7e274050a3 shaderir: Add swizzling 2020-05-17 02:24:35 +09:00
Hajime Hoshi
7648271eff shaderir: Implement bulit-in functions 2020-05-17 00:33:22 +09:00
Hajime Hoshi
6553c237a1 shaderir: Add comments 2020-05-16 23:42:32 +09:00
Hajime Hoshi
8f4e93338c shaderir: Implement sampler2D 2020-05-16 23:33:20 +09:00
Hajime Hoshi
316e502f4b shaderir: Add predefined macros 2020-05-16 23:29:01 +09:00
Hajime Hoshi
66e76597d8 shaderir: Implement fragment function 2020-05-16 23:07:24 +09:00
Hajime Hoshi
ddaed674dd shaderir: Implement vertex function 2020-05-16 22:50:20 +09:00
Hajime Hoshi
eb5a2efad8 shaderir: Implement return 2020-05-16 20:16:04 +09:00
Hajime Hoshi
57d80c185e shaderir: Implement call 2020-05-16 19:19:16 +09:00
Hajime Hoshi
5b69e81bd7 shaderir: Add more tests 2020-05-16 18:09:09 +09:00