Commit graph

629 commits

Author SHA1 Message Date
Rémi Verschelde
13a90e938f
Merge pull request #70096 from rune-scape/stringname-dict
StringName Dictionary keys
2024-09-03 17:38:06 +02:00
Jan Haller
82b2a58f4c Fix bool type appearing in GDExtension header 2024-08-31 22:40:48 +02:00
Rémi Verschelde
4c0ce657d5
Merge pull request #96322 from RandomShaper/wtp_info
WorkerThreadPool: Print info about thread count at startup
2024-08-30 23:37:58 +02:00
Danil Alexeev
49bcdf78a7
Core: Сheck r_error after calling callp() 2024-08-30 21:09:30 +03:00
Pedro J. Estébanez
db4672f83f WorkerThreadPool: Print info about thread count at startup 2024-08-30 13:04:46 +02:00
Rémi Verschelde
a5830f6eb9
Merge pull request #96317 from Chaosus/objectdb_write_path_instead_of_name_at_cleanup
Write path instead of name at verbose output of leaked instances
2024-08-30 11:43:13 +02:00
Rémi Verschelde
909629d9f9
Merge pull request #96166 from AThousandShips/more_lock_raii
Use `MutexLock` in more places
2024-08-30 09:59:19 +02:00
Rémi Verschelde
f0ee0bdd37
Merge pull request #93972 from Hilderin/fix-editor-needs-restart-after-adding-gdextensions
Fix editor needs restart after adding GDExtensions
2024-08-30 09:59:05 +02:00
Chaosus
75055a8278 Write path instead of name at verbose output of leaked instances 2024-08-30 10:58:50 +03:00
rune-scape
154049ce17 StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
2024-08-29 13:39:27 -07:00
demolke
c409e6d722 Import/export GLTF extras to node->meta
This is useful for custom tagging of objects with properties (for example in Blender) and having this available in the editor for scripting.

- Adds import logic to propagate the parsed GLTF extras all the way to the resulting Node->meta
- Adds export logic to save Godot Object meta into GLTF extras
- Supports `nodes`, `meshes` and `materials` (in GLTF sense of the words)
2024-08-29 19:17:04 +02:00
A Thousand Ships
e33fdb4296
Use MutexLock in more places 2024-08-29 14:12:59 +02:00
Hilderin
ef6f873938 Fix editor needs restart after adding GDExtensions 2024-08-29 06:15:32 -04:00
Pedro J. Estébanez
5dade0e08b WorkerThreadPool: Fix end-of-yield logic potentially leading to deadlocks 2024-08-28 15:26:08 +02:00
Rémi Verschelde
3e8d051a4a
Merge pull request #94068 from dalexeev/core-remove-is-gpl-reversed
Core: Remove unused method `_is_gpl_reversed()`
2024-08-28 00:11:58 +02:00
Thaddeus Crews
231f3323d3
Core: Fix unreachable code 2024-08-27 10:26:06 -05:00
Rémi Verschelde
9dfc41568a
Merge pull request #95984 from timothyqiu/what-identifier
Add `String.is_valid_unicode_identifier()`
2024-08-27 16:55:06 +02:00
Danil Alexeev
2d8f6c1b1d
GDScript: Fix message when calling non-tool function in tool mode 2024-08-27 12:30:15 +03:00
Haoyu Qiu
8bf4ecc026 Add String.is_valid_unicode_identifier()
- Adds `is_valid_unicode_identifier()`
- Adds `is_valid_ascii_identifier()`
- Deprecates `is_valid_identifier()`
- Renames `validate_identifier()` to `validate_ascii_identifier()`
2024-08-27 11:34:08 +08:00
Rémi Verschelde
0ba0be27c7
Merge pull request #94169 from RandomShaper/wtp_rl_prize
Batch of fixes for `WorkerThreadPool` and `ResourceLoader`
2024-08-26 10:51:25 +02:00
Rémi Verschelde
b4f268fae8
Merge pull request #91018 from Daylily-Zeleen/daylily-zeleen/optionally_postinitialization_for_extension_owner
Allow ClassDB to create a Object without postinitialization for GDExtension.
2024-08-26 10:51:17 +02:00
Rémi Verschelde
091212b4f1
Merge pull request #93602 from aaronp64/inspector_latency
Improve Editor Inspector/Theme item lookup performance
2024-08-22 00:10:26 +02:00
Pedro J. Estébanez
f4d76853b9 WorkerThreadPool (plus friends): Overhaul unlock allowance zones
This fixes a rare but possible deadlock, maybe due to undefined behavior. The new implementation is safer, at the cost of some added boilerplate.
2024-08-21 12:22:52 +02:00
Pedro J. Estébanez
28619e26cf ResourceLoader: Enhance deadlock prevention
Benefits:
- Simpler code. The main load function is renamed so it's apparent that it's not just a thread entry point anymore.
- Cache and thread modes of the original task are honored. A beautiful consequence of this is that, unlike formerly, re-issued loads can use the resource cache, which makes this mechanism much more performant.
- The newly added getter for caller task id in WorkerThreadPool allows to remove the custom tracking of that in ResourceLoader.
- The check to replace a cached resource and the replacement itself happen atomically. That fixes deadlock prevention leading to multiple resource instances of the same one on disk. As a side effect, it also makes the regular check for replace load mode more robust.
2024-08-21 12:19:43 +02:00
aaronp64
7593e55527 Improve Editor Inspector/Theme item lookup performance
Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab

- Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions
- Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes()
- Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead
- Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call

These changes reduce the time taken by EditorInspector::update_tree by around 30-35%
2024-08-20 13:39:40 -04:00
Daylily-Zeleen
3d575801ce Allow ClassDB to create a Object without postinitialization for GDExtension. 2024-08-20 20:19:02 +08:00
Pedro J. Estébanez
32b7f835d8 Avoid potential crash on signal disconnection 2024-08-19 12:18:04 +02:00
voidedWarranties
d65ea6fb9c Fix virtual binding for ScriptLanguageExtension::_reload_scripts 2024-08-17 21:09:32 -07:00
Haoyu Qiu
7343dc3a5d Split TranslationServer into its own file 2024-08-15 15:00:47 +08:00
Hilderin
1ed723bd19 Fix global class cache file not present when no class name 2024-07-31 16:57:25 -04:00
Alvin Wong
c9f4436073
Fix use-after-free in WorkerThreadPool 2024-07-29 14:26:48 +02:00
Rémi Verschelde
293c0f7646
Merge pull request #94526 from RandomShaper/wtp_rl_prize_prequel
Batch of fixes for WorkerThreadPool and ResourceLoader (safe set)
2024-07-19 11:11:03 +02:00
Rémi Verschelde
ab67408390
Merge pull request #94238 from RandomShaper/ref_is_now_rc
Make errors on `RefCounted.free()` more accurate
2024-07-17 11:43:32 +02:00
Pedro J. Estébanez
5b5cdf2414 Fixup recent changes to threading concerns
ResourceLoader:
- Fix invalid tokens being returned.
- Remove no longer written `ThreadLoadTask::dependent_path` and the code reading from it.
- Clear deadlock hazard by keeping the mutex unlocked during userland polling.

WorkerThreadPool:
- Include thread call queue override in the thread state reset set, which allows to simplify the code that handled that (imperfectly) in the ResourceLoader.
- Handle the mutex type correctly on entering an allowance zone.

CommandQueueMT:
- Handle the additional possibility of command buffer reallocation that mutex unlock allowance introduces.
2024-07-16 11:03:02 +02:00
Pedro J. Estébanez
10b543f8a7 WorkerThreadPool: Fix wrong sync logic breaking task map integrity 2024-07-15 12:15:25 +02:00
Pedro J. Estébanez
76bfe8e0fd Make errors on RefCounted.free() more accurate 2024-07-15 08:51:42 +02:00
Rémi Verschelde
fe5d567917
Merge pull request #93942 from MikeSchulze/73525
Fix GDScript analyzer error when instantiating EditorPlugins.
2024-07-11 09:41:09 +02:00
baptr
810fcc7431 Fix gdscript analyzer error when instantiating EditorPlugins.
Editor code is not instantiable outside of the editor
(1d14c054a1/core/object/class_db.cpp (L369)).
This is fine for editor plugins and the like, but the GDScript analyzer
balks at it, causing F5 runs to fail: #73525.

Instead, we really just want to know if the type is abstract - so add
a new ClassDB method to check that and nothing else.

Update core/object/class_db.cpp

Apply code review comments

Co-Authored-By: Bryce <1522777+baptr@users.noreply.github.com>
2024-07-10 10:24:57 +02:00
David Snopek
91fcdff01e GDExtension: Fix setting base class properties on a runtime class 2024-07-08 12:33:55 -05:00
Danil Alexeev
151f34bb80
Core: Remove unused method _is_gpl_reversed() 2024-07-08 12:31:09 +03:00
Pedro J. Estébanez
f2f9a6b8a1 WorkerThreadPool: Fix wrong pointer used in the case of BinaryMutex 2024-06-28 19:46:55 +02:00
Rémi Verschelde
6f8b90e412
Merge pull request #93032 from RandomShaper/wtp_antilock
GDScript: Avoid deadlock possibility in multi-threaded load
2024-06-28 14:42:48 +02:00
Raul Santos
175e5bcf4e
Lookup method also in base scripts of a PlaceHolderScriptInstance 2024-06-22 08:11:48 +02:00
Pedro J. Estébanez
03d14e436b WorkerThreadPool: Refactor deadlock prevention collaboration into a generic mechanism
This is strictly beyond a refactor because it also changes when the mutexes are relocked,
but that's only for extra safety.
2024-06-19 14:01:54 +02:00
Rémi Verschelde
0a83e7c5da
Merge pull request #93288 from rune-scape/gdextension-const-stringname-weird
Object: Use const correct `GDExtensionConstStringNamePtr`
2024-06-18 17:59:25 +02:00
rune-scape
ca916a536a Object: use correct GDExtensionConstStringNamePtr 2024-06-17 19:06:40 -07:00
Jovan Gerodetti
21586da50e Make profiling_get_frame_data call the correct GDVIRTUAL method. 2024-06-18 00:53:25 +02:00
Pedro J. Estébanez
21c03d1956 WorkerThreadPool: Fix thread message queue not restored after overridden in a task
Also, simplifies the thread override teardown in MessageQueue.
2024-06-13 10:31:08 +02:00
Rémi Verschelde
5bab95a556
Merge pull request #92827 from raulsntos/core/node-to_string
Use GDExtension `to_string` in Node
2024-06-12 10:00:29 +02:00
Raul Santos
29bf60cc02
Use GDExtension to_string in Node
Matches the `Object::to_string` implementation.
2024-06-11 17:40:51 +02:00