Commit Graph

7279 Commits

Author SHA1 Message Date
Rémi Verschelde
372b3f8437
Merge pull request #94910 from RandomShaper/res_load_unlocked
ResourceLoader: Let resource setup late steps invoke loading in turn
2024-07-31 11:37:41 +02:00
Pedro J. Estébanez
5640e8adc9 ResourceLoader: Let resource setup late steps invoke loading in turn 2024-07-29 18:13:37 +02:00
Alvin Wong
c9f4436073
Fix use-after-free in WorkerThreadPool 2024-07-29 14:26:48 +02:00
A Thousand Ships
8f3e2c96eb
[Core] Fix Variant::construct of Object
Variant type was not updated correctly causing leaks in ref-counted
2024-07-25 12:25:29 +02:00
bruvzg
25f78a5eb6
Replace .NET detection code with ClassDB::class_exists("CSharpScript"). 2024-07-23 23:46:14 +03:00
BlueCube3310
0ed45629fd Support 64-bit image sizes for VRAM compression 2024-07-21 21:06:14 +02:00
Hugo Locurcio
0445ccf428
Fix Image CowData crash when baking large lightmaps
This switches to 64-bit integers in select locations of the Image
class, so that image resolutions of 16384×16384 (used by
lightmap texture arrays) can be used properly. Values that are larger
should also work.

VRAM compression is also supported, although most VRAM-compressed
formats are limited to individual slices of 16384×16384. WebP
is limited to 16383×16383 due to format limitations.
2024-07-19 16:04:30 +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
Pedro J. Estébanez
28a7a95531 ResourceLoader: Fix sync issues with error reporting
This is about not letting the resource format loader set the error code directly on the task anymore. Instead, it's stored locally and assigned only when it is right to do so.

Otherwise, other tasks may see an error code in the current one before it's state having transitioned to errored. While this, besides the technically true data race, may not be a problem in practice, it causes surprising situations during debugging as it breaks assumptions.
2024-07-19 10:00:41 +02:00
Fabio Alessandrelli
31454423ba [Core] Fix TypedArray encoding when full objects is disabled 2024-07-18 09:58:17 +02:00
Rémi Verschelde
0918fd2a21
Merge pull request #94452 from jamie-pate/fix_73374
Fix game window stops responding when debugger pauses
2024-07-17 15:45:14 +02:00
Rémi Verschelde
31f696cf03
Merge pull request #94373 from maiself/fix-library-path-as-abs
Fix to restore `library_path` as absolute path
2024-07-17 12:24:07 +02:00
Rémi Verschelde
59737bf3f0
Merge pull request #94413 from rburing/fix_action_press_tick
Fix physics tick count in `Input.action_press` and `Input.action_release`
2024-07-17 11:44:31 +02:00
Rémi Verschelde
1d13e95e06
Merge pull request #94307 from Bromeon/feature/bitfield-unsigned-docs
GDExtension docs: Advise bindings to use `uint64_t` for bitfields
2024-07-17 11:43:54 +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
Rémi Verschelde
496fd12b17
Merge pull request #94052 from m4gr3d/clean_input_dispatch_settings
Cleanup Android input on render thread settings
2024-07-17 11:42:52 +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
Ricardo Buring
b41ec93d63 Fix physics tick count in Input.action_press and Input.action_release
The physics tick count was not yet updated there.
2024-07-16 00:31:44 +02:00
Jan Haller
b2a9ea6d22 GDExtension docs: advise bindings to use uint64_t for bitfields 2024-07-15 22:37:33 +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
62d9ce6445 Re-add resource thread-safety measures
These deferring measures were added to aid threaded resource loading in being safe.

They were removed as seemingly unneeded, but it seems they are needed so resources involved in threaded loading interact with others only after "sync points".
2024-07-15 12:15:22 +02:00
Pedro J. Estébanez
76bfe8e0fd Make errors on RefCounted.free() more accurate 2024-07-15 08:51:42 +02:00
Mai Lavelle
16eea2c837
Fix to restore library_path as absolute path 2024-07-14 20:37:38 -04: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
Rémi Verschelde
34d4c9197d
Merge pull request #94133 from akien-mga/fix-gcc14-Wmaybe-uninitialized
Fix a couple GCC 14 `-Wmaybe-uninitialized` warnings
2024-07-11 00:27:32 +02:00
Jamie Pate
b18e1e0dcd Fix Game window stops responding when debugger pauses
Fixes #73374

As of godot 4 On windows/osx the game window will be frozen and will not
be updated.

In the debugger loop it calls

OS::get_singleton()->process_and_drop_events();
which allows windows/osx to handle system events. If the window doesn't
handle these events then both systems will judge the window to be 'not
responding' (osx beachball cursor)

When the event processing code was migrated from OS to DisplayServer the
process_and_drop_events() logic was moved to DisplayServer, but the call
inside the remote debugger pause loop was not updated to call the
DisplayServer version, there are currently no implementations of
OS::process_and_drop_events() so i removed it and switched to the new
DisplayServer::force_process_and_drop_events() method.
2024-07-10 13:38:57 -07: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
Fredia Huya-Kouadio
5e59819727 Cleanup Android input on render thread settings
Follow up to https://github.com/godotengine/godot/pull/93933
Clean up the set of settings use to control whether Android input should be dispatched on the render thread.

Addresses comments in https://github.com/godotengine/godot/pull/93933#issuecomment-2210437977
2024-07-09 09:15:18 -07:00
Rémi Verschelde
247a481001
Fix a couple GCC 14 -Wmaybe-uninitialized warnings 2024-07-09 16:12:22 +02:00
Danil Alexeev
110c4d4067
GDScript: Fix "Mismatched external parser" for autoloads 2024-07-09 16:16:45 +03:00
Rémi Verschelde
daba91d8c6
Merge pull request #93897 from akien-mga/vformat-better-error-message
Core: Improve `vformat` error reporting on `sprintf` failure
2024-07-09 00:03:17 +02:00
Rémi Verschelde
8ed9bfdc25
Merge pull request #94089 from dsnopek/gdext-valid-runtime-properties
GDExtension: Fix setting base class properties on a runtime class
2024-07-08 23:53:12 +02:00
David Snopek
91fcdff01e GDExtension: Fix setting base class properties on a runtime class 2024-07-08 12:33:55 -05:00
Rémi Verschelde
3ced38cf28
Merge pull request #94073 from mihe/macos-home-end
Add Home/End to text caret movements on macOS
2024-07-08 19:13:39 +02:00
Mikael Hermansson
085f0cc50a Add Home/End to text caret movements on macOS 2024-07-08 16:08:27 +02:00
Pedro J. Estébanez
a426479b3f ResourceLoader: Fix error message due to already-awaited tasks being re-awaited 2024-07-08 12:19:44 +02:00
Pedro J. Estébanez
f952d3956c ResourceLoader: Fixup management of thread-specific status
- Allows the message queue override to flush after loading each resource, which was the original intent.
- Removes a redundant call to mark the thread as safe-for-nodes.
2024-07-08 10:30:25 +02:00
Ricardo Buring
23521635d2 Fix physics tick counter
The counter is now incremented at the start of a physics tick rather than at the end.

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-07-07 19:04:05 +02:00
Rémi Verschelde
438382cdc2
Merge pull request #94006 from alvinhochun/log-file-utf8-fix
Fix UTF-8 misintepreted as Latin-1 when logging to file
2024-07-07 12:38:54 +02:00
Rémi Verschelde
5bc5ea898c
Merge pull request #93993 from Chaosus/astargrid2d_update_fix
Add a check to prevent user to call `AStarGrid2D::update` when its not needed
2024-07-07 12:38:44 +02:00
Rémi Verschelde
7197678df2
Merge pull request #91551 from m4rr5/configure_timestamp_query_elements
Add a project setting to configure the maximum number of timestamps.
2024-07-07 12:38:19 +02:00
Alvin Wong
5b3857e5f1 Fix UTF-8 misintepreted as Latin-1 when logging to file 2024-07-07 02:46:41 +08:00
Yuri Rubinsky
453c8753a9 Add a check to prevent user to call AStarGrid2D::update when its not needed 2024-07-06 14:59:38 +03:00
Rémi Verschelde
496b7b8482
Core: Improve vformat error reporting on sprintf failure
And fix a few occurrences of formatting errors that led me to this.
2024-07-04 10:54:55 +02:00
lawnjelly
0ed71f3e0c Physics Interpolation - Fix interpolated_transform_2d
Uses the skew correct `Transform2D::interpolate_with()` function rather than the bugged 3.x version.
2024-07-02 08:10:55 +01:00
Rémi Verschelde
152d7c1bba
Revert "Make freed object different than null in comparison operators"
This reverts commit 150b50cfcd.

As discussed with the GDScript team, this has some implications which aren't
fully consensual yet, and which we want to revisit.

For now we revert to the 4.2 behavior for the 4.3 release, to avoid breaking
user expectations.
2024-07-01 14:11:43 +02: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
e052a53bb6
Merge pull request #93695 from RandomShaper/res_load_main_th
`ResourceLoader`: Support polling and get-before-complete on the main thread
2024-06-28 14:43:01 +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
Pedro J. Estébanez
ec61c5064c ResourceLoader: Support polling and get-before-complete on the main thread 2024-06-28 11:25:10 +02:00