Commit graph

255 commits

Author SHA1 Message Date
Yuri Rubinsky
ae95531e64 Forbid calling of derivative functions in incorrect functions 2024-06-21 20:47:21 +03:00
Yuri Rubinsky
aecc4cbc47 Prevent using built-ins for func names in shaders 2024-05-30 21:33:21 +03:00
Yuri Rubinsky
246a760323 Fix completion of functions with struct param/return type in shaders 2024-05-28 12:13:25 +03:00
A Thousand Ships
955d5affa8
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
A Thousand Ships
6ff6a11424
[Rendering] Add hints to some uniform PropertyInfos
* Enforce range on `int/uint`
* Use flags for `bvec2/3/4` arrays
2024-05-03 08:56:47 +02:00
Rémi Verschelde
8901e8776a
Merge pull request #90587 from clayjohn/reversez-shader-warn
Warn users when assigning `VERTEX` directly to `POSITION` due to compatibility breakage from Reverse Z changes
2024-04-16 13:30:47 +02:00
clayjohn
2f83b400a8 Warn users when assigning VERTEX directly to POSITION due to compatibility breakage from reverse z changes 2024-04-12 10:38:35 -07:00
ze2j
993cd25ff2 Fix false positive errors in gdshaderinc files
These language features are wrongly detected as errors (not supported)
when used in gdshaderinc files:
- instance uniforms
- hint_normal_roughness_texture
- hint_depth_texture

This type of error should only occur when the shader type is not spatial
and not a gdshaderinc file.
2024-03-21 15:46:41 +01:00
Muller-Castro
96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
jsjtxietian
089e7f473d Fix assign with swizzle in shader not doing varying validation check 2023-10-23 17:52:50 +08:00
Rémi Verschelde
b4214b1686
Merge pull request #83004 from Chaosus/shader_language_fix_typo
Fix typo in `shader_language.cpp`
2023-10-09 23:23:35 +02:00
Yuri Rubinsky
f4bc779c4e Fix typo in shader_language.cpp 2023-10-08 18:55:40 +03:00
A Thousand Ships
f18aa00e85 Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-10-08 17:23:33 +02:00
Rémi Verschelde
24c166dfe2
Merge pull request #81619 from Chaosus/fix_shader_const
Re-allows constants in global space to be initialized with function call
2023-10-03 17:20:23 +02:00
Rémi Verschelde
2c8c7b95aa
Merge pull request #82313 from AThousandShips/null_check_servers
[Servers] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-09-26 13:45:31 +02:00
A Thousand Ships
fdd3d36c6d [Servers] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-25 18:45:30 +02:00
Yuri Roubinski
d3d20f15bf Re-allows constants in global space to be initialized with function call 2023-09-13 21:04:29 +03:00
bitsawer
3c042fb99f Fix shader language preprocessor include marker handling 2023-09-06 16:57:40 +03:00
Yuri Rubinsky
35802374ac Add coloring for completion of vector components 2023-08-30 21:13:25 +03:00
Yuri Sizov
372e9abcfc Merge pull request #79459 from MoltenCoffee/fix-shader-arguments-error
Add error for undefined function in shader
2023-07-24 19:32:46 +02:00
MoltenCoffee
16c3f4be2d
Add error for undefined function in shader 2023-07-18 10:01:29 +02:00
Hayden Leete
fc7063b2e2 Add autocomplete for filter/repeat hints on uniform arrays 2023-07-13 11:27:28 +12:00
Yuri Sizov
65cc4db0ae Merge pull request #79100 from KoBeWi/[filter,_filter,_filter,_filter,_filter,_filter]
Allow more hint types for uniform arrays
2023-07-12 14:18:34 +02:00
Rémi Verschelde
46cd84b362
Merge pull request #78839 from lewiji/normal_roughness_mobile_fix
Fix invalid shader compilation when using `hint_normal_roughness_texture` in mobile backend
2023-07-08 18:19:49 +02:00
kobewi
8ae2e6681e Allow more hint types for uniform arrays 2023-07-06 15:05:26 +02:00
Yuri Roubinski
1994c25701 Fix using uint suffix at the hex number declaration in shaders 2023-07-01 14:33:48 +03:00
lewiji
2a93681334 Return shader parse error when using 'hint_normal_roughness_texture' and not using the Forward+ backend 2023-06-29 16:18:31 +01:00
bitsawer
23c375d6b4 Fix shader uniform storage conversions and crash 2023-05-29 15:17:13 +03:00
Yuri Rubinsky
719741b0eb Exclude incorrect completion options for render_mode in shaders 2023-05-15 08:21:16 +03:00
Ninni Pipping
71ee65dc57 Enable shadow warnings and fix raised errors 2023-05-11 16:00:59 +02:00
Yuri Rubinsky
12142f2b50 Fix completion of source_color hint for texture arrays in shaders 2023-04-08 20:13:26 +03:00
Fabio Iotti
528e0d095e Error on hint_normal_roughness_texture and hint_depth_texture outside of spatial shader 2023-03-03 21:36:48 +01:00
Yuri Rubinsky
94831c7209 Forbid passing multiview sampler to the custom function in shaders 2023-02-21 11:23:17 +03:00
Haoyu Qiu
84aee17901 Improvements and fixes based on Weblate comments
* Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted".
* Spell out "Animation" instead of using "Anim.".
* Treat "Max" as regular word instead of writing "Max.".
* Use generic "Set %s" for action name instead of a dedicated "Set target_position".
* Add translator comment for:
    * "Inclusive" and "Self" in the profiler.
    * Places where it needs the context about being an editor progress label.
    * "Duplicated Animation Name" since it's refering to the new name of a duplicated animation.
    * Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal".
* Fix wrong undo action name for renaming an input action.
* Fix missing end quote in a shader error message.
* In class reference:
    * Fix duplicated "if" in the description of `signf()`.
    * Fix mismatched example output in `String.operator %()`.
    * Fix typo in the description of `Decal.texture_emission`.
    * Unify description of `String.match()` and `StringName.match()`.
2023-02-13 15:22:18 +08:00
Haoyu Qiu
a40ccc2d7e Improve some editor strings for localization 2023-02-09 19:32:02 +08:00
clayjohn
04a9933f2e Mark fma function as high end so it isn't used with the gl_compatibility renderer 2023-02-08 12:56:15 -08:00
Rémi Verschelde
9caf691c89
Merge pull request #72494 from Chaosus/shader_fix_const_init
Fix shader failure when using non-const initializer on a constant
2023-02-02 21:05:27 +01:00
Rémi Verschelde
e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
Yuri Rubinsky
e034d5f764 Fix shader failure when using non-const initializer on a constant 2023-02-01 13:03:11 +03:00
clayjohn
97ed3dcf71 Add a shader error when trying to using hint_normal_roughness_texture in the gl_compatibility renderer 2023-01-30 09:04:34 -08:00
Rémi Verschelde
3cacc83526
Merge pull request #72138 from clayjohn/GL-globals
Properly append global uniform buffer name in gl_compatibility shaders
2023-01-26 22:52:42 +01:00
Rémi Verschelde
b2164ee75b
Merge pull request #72109 from Chaosus/shader_derivative
Add derivative functions with precision to shaders
2023-01-26 22:51:54 +01:00
clayjohn
eefddb07bc Properly append global uniform buffer name in gl_compatibility shaders
Also error when using instance uniforms
2023-01-26 12:14:45 -08:00
Yuri Rubinsky
8c8c333bf2 Add derivative functions with precision to shaders 2023-01-26 20:53:46 +03:00
bitsawer
6f5598979f Several shader preprocessor parser fixes and improvements 2023-01-26 14:57:23 +02:00
Yuri Rubinsky
a6eb6b6b55 Fix array of token names in the shader parser 2023-01-25 18:18:07 +03:00
PrecisionRender
d9698f0e6f Fix type in hint when using removed built-in textures 2023-01-20 22:06:51 -06:00
clayjohn
921f99f9e3 Decrement texture_binding count when using screen textures 2023-01-20 12:48:13 -08:00
clayjohn
faea9f5c10 Remove SCREEN_TEXTURE, DEPTH_TEXTURE, and NORMAL_ROUGHNESS_TEXTURE
in favour of texture hints
2023-01-18 19:52:47 -08:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00