1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00
Commit Graph

726 Commits

Author SHA1 Message Date
Pedro J. Estébanez
2d885a3163 Sanitize ClassDB locking 2025-03-25 16:50:46 +01:00
Thaddeus Crews
8f331ebd9c Merge pull request #103099 from YeldhamDev/build_res_loader_disable
Disable `ResourceFormatLoader/Saver`s of disabled classes
2025-03-23 19:04:01 -05:00
Thaddeus Crews
fd45f42464 Merge pull request #101361 from Repiteo/core/isolate-ref-logic
Core: Isolate `Ref` forward declare logic
2025-03-23 19:03:54 -05:00
Thaddeus Crews
d9ef361d12 Core: Isolate Ref forward declare logic 2025-03-23 08:22:00 -05:00
Thaddeus Crews
f09ee0171a Style: Begin integrating simple .clangd fixes 2025-03-22 13:24:35 -05:00
Michael Alexsander
090358afcf Disable ResourceFormatLoader/Savers of disabled classes 2025-03-21 14:23:05 -03:00
Rémi Verschelde
96a5d62507 Merge pull request #104355 from YYF233333/hashmap_iter
Optimize `ClassDB::get_direct_inheriters_from_class`
2025-03-21 13:03:53 +01:00
Rémi Verschelde
1f682b6554 Merge pull request #104237 from Ivorforce/optimize-thread-pool-waiting
Optimize thread pools by avoiding needless locks and unlocks of the `task_mutex`.
2025-03-21 13:03:37 +01:00
Yufeng Ying
c37c92b450 Optimize ClassDB::get_direct_inheriters_from_class.
Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com>
2025-03-19 23:26:46 +08:00
Thaddeus Crews
4320800621 Core: Expand is_zero_constructible coverage 2025-03-17 11:45:26 -05:00
Lukas Tenbrink
9d30732c5b Optimize thread pools by avoiding needless locks and unlocks of the task_mutex. 2025-03-16 15:33:55 +01:00
Thaddeus Crews
b377562b52 Merge pull request #91660 from AThousandShips/methodinfo_vec
[Core] Use `Vector` for `MethodInfo::arguments`
2025-03-14 10:06:13 -05:00
Thaddeus Crews
c1b7865ae9 Merge pull request #103557 from aaronfranke/godot-version-defines
Rename version defines to `GODOT_VERSION_*` to match GDExtension godot-cpp
2025-03-13 08:57:42 -05:00
Aaron Franke
97ee05e9b7 Rename version defines to GODOT_VERSION_* to match GDExtension godot-cpp 2025-03-12 11:11:38 -07:00
Yufeng Ying
bebe037abf Add ConstIterator to Dictionary. 2025-03-13 01:28:46 +08:00
A Thousand Ships
d9721954e6 [Core] Use Vector for MethodInfo::arguments 2025-03-10 13:57:53 +01:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Thaddeus Crews
96fdaa616b Style: Integrate #pragma once in builders/checks 2025-03-07 17:32:33 -06:00
kobewi
c6c1a49bea Don't edit objects when loading folding 2025-03-06 15:04:00 +01:00
Pāvels Nadtočajevs
53bb897458 Use separate WorkThreadPool for shader compiler. 2025-03-03 22:28:39 +02:00
Thaddeus Crews
acddf31c39 Merge pull request #101489 from RandomShaper/optimize_classnames_enumeration
Optimize classnames enumeration
2025-02-04 09:03:59 -06:00
Thaddeus Crews
699237d243 Merge pull request #102131 from dsnopek/classdb-bind-method-custom-leak
Fix memory leak when `ClassDB::bind_method_custom()` fails
2025-01-30 11:39:04 -06:00
Pedro J. Estébanez
318af42020 Include more attributes in the global class names cache 2025-01-29 09:39:50 +01:00
David Snopek
e904c0c014 Fix memory leak when ClassDB::bind_method_custom() fails 2025-01-28 11:10:35 -06:00
Thaddeus Crews
1aed2f577e Merge pull request #100904 from kiroxas/fixVariantMSVCWorkaround
Fix MSVC Variant Workaround
2025-01-28 09:03:33 -06:00
ialex32x
6b225ebe24 Fix index check in MethodBind::get_argument_type 2025-01-16 15:47:50 +08:00
David Snopek
696285f23a Use MethodInfo::get_compatibility_hash() to generate the hash for MethodBind::get_hash() and other GDExtension hash clean up 2025-01-11 15:57:42 -06:00
Rémi Verschelde
6a8ca81789 Merge pull request #100674 from dsnopek/gdextension-virtual-method-compat
GDExtension: Add compatibility system for virtual methods
2025-01-11 22:29:38 +01:00
David Snopek
39f16e70f8 GDExtension: Add compatibility system for virtual methods 2025-01-10 16:00:05 -06:00
Rémi Verschelde
d9535301ab Merge pull request #101001 from adamscott/fix-metadata-script
Fix Script metadata usage
2025-01-07 10:14:46 +01:00
Adam Scott
6db599232e Fix Script metadata usage 2025-01-03 11:12:37 -05:00
Thaddeus Crews
e06d83860d Style: Enforce AllowShortFunctionsOnASingleLine 2025-01-02 10:09:41 -06:00
Kiro
52ee437d7e try Fixing Variant workaround 2024-12-29 16:35:10 +01:00
Thaddeus Crews
3c304ab7cc Merge pull request #96076 from AThousandShips/improve_null_check_core_drivers
[Core,Drivers] Improve use of `Ref.is_null/valid`
2024-12-23 11:14:58 -06:00
Thaddeus Crews
bf9ef5f8a5 Merge pull request #100564 from YYF233333/iwyu
Remove unused headers in core
2024-12-19 19:59:55 -06:00
Yufeng Ying
be86ce3103 Apply iwyu suggestion in core. 2024-12-19 00:43:47 +08:00
Rémi Verschelde
851d8e49e8 Merge pull request #100386 from hpvb/core-ubsan
Core: Fix UBSAN reports
2024-12-18 17:23:32 +01:00
HP van Braam
240f510fa7 Core ubsan fixes
This fixes UBSAN errors reported by running our testsuite, importing the
TPS demo, and running the TPS demo. I have tried, wherever possible, to
fix issues related to reported issues but not directly reported by UBSAN
because thse code paths just happened to not have been exercised in
these cases.

These fixes apply only to errors reported, and caused by, core/

The following things have been changed:

* Make sure there are no implicit sign changing casts in core.
* Explicitly type enums that are part of a public API such that users of
  the API cannot pass in wrongly-sized values leading to potential stack
  corruption.
* Ensure that memcpy is never called with invalid or null pointers as
  this is undefined behavior, and when the engine is built with
  optimizations turned on leads to memory corruption and hard to debug
  crashes.
* Replace enum values only used as static values with constexpr static
  const values instead. This has no runtime overhead. This makes it so
  that the size of the enums is explicit.
* Make sure that nan and inf is handled consistently in String.
* Implement a _to_int template to ensure that all of the paths use the
  same algorhithm, and correct the negative integer case.
* Changed the way the json serializer precision work, and added tests to
  verify the new behavior. The behavior doesn't quite match master in
  particulary for negative doubles as the original code tried to cast -inf
  to an int. This then led to negative doubles losing all but one of
  their decimal points when serializing. Behavior in GDScript remains
  unchanged.
2024-12-18 14:31:12 +01:00
Hugo Locurcio
7a04d85ec3 Only allow valid types in Decal, Light3D projector, PointLight2D texture and CSGMesh3D mesh
If an invalid type is supplied (which can still be done from a script),
a warning is printed (along with a workaround for ViewportTexture).

This also adds support for "negative" resource hints such as
"Texture2D,-ViewportTexture" to exclude one or more subclasses
from a class hint.

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2024-12-17 20:41:12 +01:00
Thaddeus Crews
e42c22f359 Merge pull request #100426 from Ivorforce/variant-move-constructor
Add move assignment and move constructor to Variant.
2024-12-16 12:09:52 -06:00
Thaddeus Crews
9c9af038d5 Merge pull request #91060 from dalexeev/code-edit-add-doc-tooltips
Code Editor: Add documentation tooltips
2024-12-16 12:09:45 -06:00
Rémi Verschelde
08508d2e01 Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
Lukas Tenbrink
34fa0bf3ec Add move assignment and move constructor to Variant.
Add `_to_variant` helper functions to `gdvirtual.gen.inc` to work around an MSVC bug.
2024-12-15 14:38:46 +01:00
Danil Alexeev
80d11500b5 Code Editor: Add documentation tooltips 2024-12-15 10:51:33 +03:00
HP van Braam
6f7525c396 Improve Scene Tree editor performance
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

In order to know what Nodes need to be updated we add a
editor_state_changed signal to Node, this is a TOOLS_ENABLED,
editor-only signal fired when changes to Node happen that are relevant
to editor state.

We also now make sure that when nodes are moved/renamed we don't check
expensive properties that cannot contain NodePaths. This saves a lot of
time when SceneTreeDock renames a node in a scene with a lot of
MeshInstances. This makes renaming nodes go from ~27 seconds to ~2
seconds on large scenes.

SceneTreeEditor instances will now also not do all of the potentially
expensive update work if they are invisible. This behavior is turned off
by default so it won't affect existing users. This change allows the
editor to only update SceneTreeEditors that actually in view. In
practice this means that for most changes instead of updating 6
SceneTreeEditors we only update 1 instantly, and the others only when
they become visible.

There is definitely more that could be done, but this is already a
massive improvement. In complex scenes we see an improvement of 10x,
things that used to take ~30 seconds now only take 2.

This fixes #83460

I want to thank KoBeWi, TokisanGames, a-johnston, aniel080400 for
their tireless testing. And AeioMuch for their testing and providing a
fix for the hover issue.
2024-12-12 22:47:05 +01:00
Rémi Verschelde
2153a60425 Revert "Avoid duplicating signals from scene instances into packed scenes"
This partially reverts commit 8a42e3d3ef.

Comment improvements and the test case were kept, with one part commented out.
2024-12-10 10:42:58 +01:00
Lukas Tenbrink
b5c31ebb41 Add contains_char() for single-character 'contains' calls. 2024-12-06 20:23:35 +01:00
rune-scape
d58b2e879f Get rid of easily removable uses of const_cast 2024-12-01 17:50:13 -08:00
Rémi Verschelde
56a7dba10b Merge pull request #99799 from akien-mga/fix-typos
Fix various typos and code style issues
2024-11-29 22:02:53 +01:00
cixil
8a42e3d3ef Avoid duplicating signals from scene instances into packed scenes 2024-11-29 18:29:08 +01:00