Commit graph

782 commits

Author SHA1 Message Date
Yuri Roubinsky a757bd7625 Allow to reassign local variables in shaders 2020-03-20 14:09:43 +03:00
Yuri Roubinsky 523dae6bba Fix shader TIME auto-completion 2020-03-19 21:42:06 +03:00
Yuri Roubinsky ef6320d82a Removed old TIME references from shader_types 2020-03-19 19:09:15 +03:00
Yuri Roubinsky dbffa2e0bb Makes shader 'TIME' available in custom functions by default 2020-03-19 17:58:39 +03:00
Yuri Roubinsky 387d6859d7 Show shader method out/inout qualifier in intellisense 2020-03-18 16:06:47 +03:00
Yuri Roubinsky 4709434227 Fix shader crash if passing const values to modf function 2020-03-18 14:07:35 +03:00
Rémi Verschelde cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Yuri Roubinsky 7a2c6a8c0e Enables passing out built-in parameter from parent function in shaders 2020-03-14 10:46:27 +03:00
luz.paz 7bf6e5f773 Fix various typos
Found via `codespell`
2020-03-11 13:59:18 -04:00
Rémi Verschelde e89754fa1f
Merge pull request #36021 from YeldhamDev/intersects_touch_expose
Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()'
2020-03-04 20:32:20 +01:00
Rémi Verschelde a0e33e17fb
Merge pull request #36733 from qarmin/static_analyzer_fixes
Fixes bugs found by Sonarcloud and Coverity
2020-03-04 13:41:38 +01:00
Michael Alexsander 8c8c48a7ad Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()' 2020-03-04 09:32:34 -03:00
Mateo Dev .59 c933eb7acc Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert 2020-03-04 04:44:47 -03:00
Rémi Verschelde c292aab247
Merge pull request #36691 from clayjohn/VULKAN-cubemap-roughness
Improve cubemap importance sampling
2020-03-02 19:32:19 +01:00
qarmin 1f209bfc41 Fixes bugs found by Sonarcloud and Coverity 2020-03-02 19:17:20 +01:00
clayjohn a422b8c497 Properly free reflection probe atlas 2020-02-29 23:26:57 -08:00
clayjohn 6bb5117955 Improve cubemap importance sampling 2020-02-29 17:16:50 -08:00
Rémi Verschelde 93dd3d29d2
Merge pull request #36679 from clayjohn/VULKAN-mem-leak
Remove minimum size for shadow atlas
2020-02-29 23:32:16 +01:00
clayjohn 03d46ea804 Remove minimum size for shadow atlas 2020-02-29 10:09:15 -08:00
Yuri Roubinsky 924a9bfd16 Fix shader's step hint range for integers 2020-02-29 09:56:02 +03:00
clayjohn 74f6e3e1aa Reduce descripter sets in cubemap filter 2020-02-28 09:07:09 -08:00
clayjohn 3e299aa225 Basic fast filtering implementation 2020-02-27 22:30:34 -08:00
Rémi Verschelde a596d76156
Merge pull request #36627 from clayjohn/VULKAN-free
Properly free many Vulkan resources
2020-02-28 06:39:18 +01:00
Rémi Verschelde b7b3978684
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
2020-02-28 00:26:01 +01:00
clayjohn b616c728d7 Properly free many vulkan resources 2020-02-27 15:01:49 -08:00
Rémi Verschelde 3a7f1300ee
Merge pull request #36186 from Calinou/remove-vulkan-debugging-prints
Remove Vulkan debugging prints
2020-02-27 21:11:24 +01:00
Pedro J. Estébanez 18fbdbb456 Reimplement Mutex with C++'s <mutex>
Main:
- It's now implemented thanks to `<mutex>`. No more platform-specific implementations.
- `BinaryMutex` (non-recursive) is added, as an alternative for special cases.
- Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes.
- Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts.
- A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this.
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- Thread-safe utilities are therefore simpler now.

Misc.:
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
- Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock).
- `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
2020-02-26 20:40:10 +01:00
Rémi Verschelde be4a516b77
Merge pull request #36428 from clayjohn/VULKAN-ref-probe-sky
Properly flip sky when rendering reflection probes
2020-02-26 18:59:50 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Rémi Verschelde 2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
clayjohn b0ff427a2a properly flip sky when rendering reflection probes 2020-02-21 11:42:00 -08:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Andrii Doroshenko (Xrayez) fa766265a7 Fix MIMPAMPS typos in constants throughout the engine 2020-02-20 01:31:43 +02:00
Rémi Verschelde 49fec646cb Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings
raised by GCC 8 and 9.

Fix -Wunused-function, -Wunused-private-field and
-Wtautological-constant-out-of-range-compare raised by Clang.

Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison
operation).

GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising
errors and will thus not abort compilation with `werror=yes`.

Treat glslang headers are system headers to avoid raising warnings.

Re-enables us to build with `werror=yes` on Linux and macOS, thus
catching warnings that would be introduced by new code.

Fixes #36132.
2020-02-18 20:51:25 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Yuri Roubinsky a1da8560ee Fix shader crash if duplicated struct members created 2020-02-15 22:19:45 +03:00
Haoyu Qiu d9b5cbdffa Fixes memory leaks in GdNavigationServer and RasterizerSceneHighEndRD 2020-02-15 14:25:32 +08:00
Marcin Zawiejski 2842c6a88c fix oob write when calling MultiMesh::set_instance_transform 2020-02-14 17:48:48 +01:00
Rémi Verschelde 415a901b68
Merge pull request #36194 from dragmz/dragmz/exit_crash_fix
Fix crash when closing project manager
2020-02-14 14:31:54 +01:00
Rémi Verschelde 79d42069a9
Merge pull request #36208 from akien-mga/warnings
Fix various GCC compilation warnings after Vulkan merge
2020-02-14 13:49:20 +01:00
Rémi Verschelde d2537407ef Fix various GCC compilation warnings after Vulkan merge
Part of #36132.
2020-02-14 10:02:31 +01:00
clayjohn b878e5bbe8 Fix error flood with sky background 2020-02-13 16:31:21 -08:00
Marcin Zawiejski 17ea60bb92 fix crash when closing project manager 2020-02-13 22:03:46 +01:00
Yuri Roubinsky 41643e268e Prevent usage 'out' modifier on opaque shader types (textures currently) 2020-02-13 21:02:47 +03:00
Hugo Locurcio 71b74195de
Remove Vulkan debugging prints 2020-02-13 18:50:07 +01:00
Yuri Roubinsky 01de6513ac Fix bugs in shader swizzling 2020-02-13 18:11:21 +03:00
Yuri Roubinsky 516aa46fe5 Fix shader crash if pass const argument to 'out/inout' parameter 2020-02-13 16:15:08 +03:00
Juan Linietsky cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Yuri Roubinsky 4aa31a2851
Merge pull request #36141 from Chaosus/shader_struct_member_arrays
Added support for arrays as shader struct members
2020-02-12 20:12:05 +03:00
Yuri Roubinsky 6b99bda1e8 Added support for arrays as shader struct members 2020-02-12 17:10:20 +03:00