Commit graph

79 commits

Author SHA1 Message Date
reduz 700f9d916d More fixes to mobile renderer
* Specify all precision qualifiers
* Makes renderer work on Adreno Vulkan
2021-08-18 12:20:19 -03:00
Yuri Roubinsky fa96c98bdf Fix shader crash when using local var with the same name as varying 2021-08-13 09:20:16 +03:00
Rémi Verschelde b63af73435
Merge pull request #51391 from Chaosus/shader_param_names
Added parameter names to shader built-in function autocompletion
2021-08-12 14:58:11 +02:00
Yuri Roubinsky fb37846b00 Added parameter names to shader built-in function autocompletion 2021-08-12 11:19:53 +03:00
Yuri Roubinsky efc6b29601
Merge pull request #51505 from Chaosus/shader_fix_shadetype-errorline 2021-08-11 14:46:04 +03:00
Yuri Roubinsky 2fb5231bbc Break futher shader compilation after missing ; aftershader_type 2021-08-11 12:37:59 +03:00
Yuri Roubinsky 0f42a29864 Allow using more assignment operators on matrixes in shaders 2021-08-11 11:51:39 +03:00
Yuri Roubinsky fead1595f9 Fix shader crash when using varying array in fragment->light context 2021-08-11 09:44:00 +03:00
Yuri Roubinsky c082982a47 Fix editor crash if passing index as variable to function parameter 2021-07-26 17:42:52 +03:00
Yuri Roubinsky b47b3a9957 Prevents shader crashing if varying assigned incorrectly 2021-07-26 14:47:14 +03:00
Yuri Roubinsky 3013324a4e Fix compilation of shader_language.cpp 2021-07-26 13:44:21 +03:00
Rémi Verschelde a8fcfbf029
Merge pull request #50729 from Chaosus/shader_varying_enchancements2
Allow using vertex-stage varying in both `fragment` and `light` functions
2021-07-26 12:17:49 +02:00
Rémi Verschelde 9b9e09f675
Merge pull request #50728 from Chaosus/shader_varying_enchancements
Allow using vertex varying in custom functions under any circumstances
2021-07-26 12:17:40 +02:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Yuri Roubinsky 17b462cc5f Allow using vertex-stage varying in both fragment and light 2021-07-22 11:55:14 +03:00
Yuri Roubinsky 94a7b04a01 Allow using vertex varying in custom functions under any circumstances 2021-07-22 11:27:13 +03:00
Yuri Roubinsky 39c06604cd Forbid varyings from assigning in custom functions to prevent crashes 2021-07-21 14:12:54 +03:00
Yuri Roubinsky 14d5b47a27 Prevent error if varying assigned but not used (push warning instead) 2021-07-15 18:07:19 +03:00
Yuri Roubinsky 5100eed012 Added a shader warning about unused local variable 2021-06-29 15:39:37 +03:00
Lightning_A b6af2a29eb Rename is_valid_integer() to is_valid_int()
Method from `String`
2021-06-16 10:32:22 -06:00
Yuri Roubinsky eec82d9f75 Prevent shader crash when returning array when return type is scalar 2021-06-06 14:59:52 +03:00
Aaron Franke 08a85352fb
Rename Variant TRANSFORM to TRANSFORM3D
Also _transform to _transform3d
2021-06-03 07:30:01 -04:00
Aaron Franke de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Yuri Roubinsky 5874b7a29c Allow shader arrays to be passed as parameters and return value 2021-05-22 20:15:03 +03:00
Yuri Roubinsky 084648bd18 Basic warning support implementation for the Godot Shading Language. 2021-05-22 19:24:31 +03:00
Yuri Roubinsky 6135744786 Implements length() shader function for arrays in structs 2021-05-19 21:50:11 +03:00
Yuri Roubinsky 96b2e54c70 Fix typo in shader_language.cpp 2021-05-18 19:01:02 +03:00
Hugo Locurcio e905e8f145
Highlight control flow keywords with a different color
This makes them easier to distinguish from other keywords.
2021-05-05 22:38:12 +02:00
Yuri Roubinsky 3c82f01134 Fix shader handle constant expressions in function call 2021-04-27 15:23:01 +03:00
Dennis Brakhane 31d41d83c3 Remove duplicate comments
A few single line comments were duplicated, probably due to bad merges.

This commit removes the obviously duplicate ones.
2021-04-25 20:03:52 +02:00
reduz d3b49c416a Refactor GLSL shader compilation
-Used a more consistent set of keywords for the shader
-Remove all harcoded entry points
-Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization.
-Entry point for sky shaders is now sky().
-Entry point for particle shaders is now process().
2021-04-14 11:37:52 -03:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
Rémi Verschelde 9bbe51dc27
Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
Rémi Verschelde e9cb64a8b5
Merge pull request #46522 from Ev1lbl0w/bugfix-shader_noret
Added missing returns on error scenarios
2021-03-01 09:36:15 +01:00
Yuri Roubinsky 19e0a1ec9d Fix parsing hexadecimal (lowercase e,f) in shaders 2021-03-01 09:08:44 +03:00
Ev1lbl0w 3d9ef1e4de
Added missing returns on error scenarios 2021-02-28 19:48:35 +00:00
Yuri Roubinsky 571f4396ea Prevents shader crash if two struct with the same name are declared 2021-02-21 13:47:09 +03:00
Yuri Roubinsky f91e7e3ba4 Prevents shader crash if passing invalid struct to the return statement 2021-02-21 07:55:40 +03:00
Yuri Roubinsky dd0874e717 Allow passing varying from fragment to light shader function 2021-02-11 15:59:21 +03:00
Aaron Franke a3e3bf8227
Make hex_to_int and bin_to_int handle the prefix automatically
Also add BinToInt to C#
2021-01-28 07:43:53 -05:00
Yuri Roubinsky 289cc89a39 Prevent crash due to assigning incorrect order of instance uniform 2021-01-10 10:52:30 +03:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Yuri Roubinsky bc0e8e7a21 Fix using post-init shader array constructors 2020-12-27 01:07:24 +03:00
Yuri Roubinsky fe4c8e387b Added support for constants in shader case and array size declaration 2020-12-17 11:51:18 +03:00
bruvzg 644f739660
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
2020-12-09 10:17:53 +02:00
George Marques 02f60812ed
Rename TYPE_REAL to TYPE_FLOAT
To be consistent with the naming everywhere else.
2020-12-04 09:47:26 -03:00
Aaron Franke 02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00