Commit Graph

345 Commits

Author SHA1 Message Date
Thaddeus Crews f94bbfc07c Merge pull request #118353 from Chaosus/shader_subgroups
Allow to define more than one subgroup level in shader material
2026-04-14 07:11:08 -05:00
Chaosus 5c667de60c Allow to define more than one subgroup level in shader material 2026-04-09 19:15:19 +03:00
Nolkaloid 1d165e7ea9 Add keyword code completion option 2026-04-08 20:04:08 +02:00
Thaddeus Crews 22a140486b Merge pull request #117157 from Chaosus/shader_restrict_uncompatible_funcs
Restrict `textureGather` shader function in Compatibility mode
2026-03-12 09:03:33 -05:00
Thaddeus Crews cc970e91e5 Merge pull request #116888 from Chaosus/shader_fix_struct
Allow using a struct name as a variable name in shaders
2026-03-09 15:18:11 -05:00
Chaosus 3085aaf924 Restrict textureGather shader function in Compatibility mode 2026-03-07 09:24:30 +03:00
Rémi Verschelde 765362b033 Explicitly include core/config/engine.h where used 2026-03-04 10:17:10 +01:00
Chaosus 9c3e52f38e Allow using a struct name as a variable name in shaders 2026-02-28 15:08:00 +03:00
Rémi Verschelde f5a290ac46 Move RenderingServer enums to a dedicated RenderingServerEnums (RSE) namespace
A number of headers in the codebase included `rendering_server.h` just for
some enum definitions. This means that any change to `rendering_server.h` or
one of its dependencies would trigger a massive incremental rebuild.

With this change, we decouple a number of classes from `rendering_server.h`,
greatly speeding up incremental rebuilds for that area.

On my machine, this reduces incremental compilation time after an edit of
`rendering_server.h` by 60s (from 2m57s).
2026-02-25 19:43:03 +01:00
Rémi Verschelde ad4b910a10 Minimize include dependencies of display_server.h
- Removes `native_menu.h` dependency from `display_server.h`.
  It's now forward-declared in all DisplayServer implementations and should
  be included in the .cpp's.
- Removes some unused `rb_set.h` and `rb_map.h` dependencies, which leads to
  having to include them explicitly in half the scene and editor codebase...
  which shows how much we depend on `display_server.h`.
- Forward-declare `input_event.h`, so now we need only `keyboard.h`.
2026-02-17 19:45:31 +01:00
Chaosus d0fc46cd83 Fix GDShader min/max functions return value type mismatch 2026-02-02 14:01:04 +03:00
Rémi Verschelde 429750f60b Merge pull request #115093 from Ivorforce/hashmap-explicit-copy
Change copy constructors of `HashMap` and `AHashMap` from implicit to explicit
2026-01-31 22:50:51 +01:00
Colin O'Rourke 63f6e3691c DrawableTextures
Implementing DrawableTextures based on: https://github.com/godotengine/godot-proposals/issues/7379
2026-01-29 01:16:06 -08:00
Lukas Tenbrink 1825e89787 Change copy constructors of HashMap and AHashMap from implicit to explicit. 2026-01-21 13:01:23 +01:00
clayjohn 6b4e26c479 Add compatibility handler to RADIANCE in sky shaders since the type was changed.
It was a textureCube, but now it is a texture2D. For compatibility purposes we need to continue exposing a cube texture. So we need to add this scaffolding to properly sample from it.
2026-01-08 16:19:38 -08:00
ghostsoft b2e87ed27f disable discard and frag errors in gdshaderinc 2025-11-08 17:26:59 +01:00
Thaddeus Crews e1e3f742b7 Merge pull request #111277 from Chaosus/shader_fix_ternary_structs
Fix ternary expression for structs in shaders
2025-11-04 16:32:40 -06:00
Thaddeus Crews d1d28c0bcf Merge pull request #111223 from Ivorforce/remove-iterator-include
Replace `std::size` usage with `std_size` to avoid `<iterator>` include.
2025-10-06 09:06:49 -05:00
Chaosus fe1447de0c Fix ternary expression for structs in shaders 2025-10-05 14:47:16 +03:00
Lukas Tenbrink 1db0a60dc0 Replace std::size usage with std_size to avoid <iterator> include. 2025-10-05 00:26:11 +02:00
Aaron Franke 3d1c9fd5de Move server files into their subfolders 2025-09-30 19:39:39 -07:00
Lukas Tenbrink f81287d765 Introduce VariantImplicitConvert<> template for types that can be implicitly converted to and from Variant.
De-duplicate a lot of `VariantGetInternalPtr`, `VariantInternalAccessor`, `VariantInitializer` and `VariantDefaultInitializer`.
2025-09-19 00:20:07 +02:00
Pāvels Nadtočajevs c3cc1ba8e4 Improve shader overloaded function error reporting. 2025-08-12 16:58:43 +03:00
Chaosus 00a755f609 Fix shader function overloads with incorrect order 2025-07-05 09:50:55 +03:00
Chaosus d3792efa89 Prevent ternary expression with a sampler types in shaders 2025-06-21 15:52:33 +03:00
Rémi Verschelde d1083c9722 Improve error messages for method calls expecting only 1 argument 2025-06-12 17:02:59 +02:00
Apples d674c9e289 Add stencil support for spatial materials 2025-06-11 09:59:10 -05:00
Thaddeus Crews de37627404 Merge pull request #102552 from DarioSamo/shader-baker
Add shader baker to project exporter.
2025-05-28 17:09:38 -05:00
Thaddeus Crews 8c6a88cda6 Merge pull request #106781 from max99x/fix-shader-crash
Fix shader compiler crash when parsing case labels with non-existent vars.
2025-05-28 09:47:36 -05:00
Dario 5a30a7e7cd Add shader baker to project exporter.
Metal Support contributed by Migeran (https://migeran.com) and Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
2025-05-27 12:45:27 -03:00
Lukas Tenbrink 4cb8a0c77e Add resize_initialized and resize_uninitialized to Vector. These functions serve as replacements for resize, to make sure the caller understands whether elements need to be initialized 'by hand' after the call. 2025-05-26 18:35:41 +02:00
Max Shawabkeh d042763750 Fix shader compiler crash when parsing case labels with non-existent vars. 2025-05-24 13:19:35 -07:00
Chaosus 16f51d4671 Remove duplicated entries from shader built-ins 2025-05-10 19:24:20 +03:00
Chaosus 5a14ab7c39 [Shaders] Allow constants and expressions in hint_range 2025-04-17 17:43:01 +03:00
Thaddeus Crews a6979ef664 Merge pull request #97801 from basicer/srgb-color-hint
Add `color_conversion_disabled` shader hint.
2025-04-14 19:39:42 -05:00
Rob Blanckaert 8c54290b4a Add color_conversion_disabled shader hint.
Sometimes shaders want to accept a color as input that is always
in the srgb color space.  This adds a hint to vec3/vec4 to enable
the color picker popup for those vectors but disable color space
conversion.
2025-04-10 21:31:15 -07:00
LuoZhihao 9e0798ed36 Shader: Fix bvec to variant conversion 2025-04-01 19:03:15 +08:00
Thaddeus Crews a03ec29ac5 Merge pull request #103434 from Chaosus/shader_fix_unused_varying_warning
Fix "unused varying" incorrect warning in shaders
2025-03-12 10:31:42 -05:00
Thaddeus Crews 7459a0361d Merge pull request #103177 from Murrent/shader_default_at_top
Allow `default` case at the top of a switch scope in shaders
2025-03-07 15:12:55 -06:00
Thaddeus Crews c937b6d180 Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
2025-03-07 15:12:25 -06:00
Chaosus 2824978178 Fix "unused varying" incorrect warning in shaders 2025-03-01 18:21:10 +03:00
Murrent 4f46ecc479 Allow default case at the top of a switch scope in shaders
Revert "Removed translations of unused error message"

This reverts commit 6dbc75e000375196eb0176e65eb41935f71fc4fe.

Variable name change

Detecting multiple default cases in shaders

Removed translations of unused error message

Allowing default case at top of scope in switch statement in shaders
2025-02-25 20:59:36 +01:00
Chaosus 946c254cec Fix crash at using increment op for varying in light shader function 2025-02-15 17:37:18 +03:00
clayjohn 35100396e4 Validate varying count when compiling shaders
This avoids crashing on devices when a number of varyings greater than the device limit is used.

For now this accurately prints an error when compiling the shader, but the error text only pops up in the editor if the number of user varyings is above the limit.
2025-02-13 15:07:15 -08:00
Lukas Tenbrink e34f1f504c Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase. 2025-02-07 14:57:48 +01:00
Chaosus 570e59df3d Fix shader uniforms has null as default value 2025-01-31 07:35:51 +03:00
Yufeng Ying e88e30c273 Remove unused headers in servers.
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2024-12-20 18:51:01 +08:00
kobewi ceefc0d38a Implement 2D instance shader parameters
Co-authored-by: kobewi <kobewi4e@gmail.com>
Co-authored-by: yesfish <huwpascoe@users.noreply.github.com>
Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
2024-12-17 23:59:16 +01:00
Thaddeus Crews 9ecdeb3723 Merge pull request #98747 from tetrapod00/standardize-renderer-strings
Standardize terms for renderers in error strings
2024-12-13 16:19:37 -06:00
Thaddeus Crews 3dacc5fb7f Merge pull request #95737 from Chaosus/shader_fix_varyings
Fix shader crash when using varyings with non-`flat` integer type
2024-12-11 17:36:06 -06:00