Commit graph

7317 commits

Author SHA1 Message Date
Rémi Verschelde
82adfebcf8
Merge pull request #94799 from m4gr3d/memory_allocation_cleanup_and_optimizations
Android memory cleanup and optimizations
2024-08-16 23:45:39 +02:00
Fredia Huya-Kouadio
a57a99f5bc Memory cleanup and optimizations
- Returns an empty list when there's not registered plugins, thus preventing the creation of spurious iterator objects

- Inline `Godot#getRotatedValues(...)` given it only had a single caller. This allows to remove the allocation of a float array on each call and replace it with float variables

- Disable sensor events by default. Sensor events can fired at 10-100s Hz taking cpu and memory resources. Now the use of sensor data is behind a project setting allowing projects that have use of it to enable it, while other projects don't pay the cost for a feature they don't use

- Create a pool of specialized input `Runnable` objects to prevent spurious, unbounded `Runnable` allocations

- Disable showing the boot logo for Android XR projects

- Delete locale references of jni strings
2024-08-16 09:27:41 -07:00
Rémi Verschelde
803dfcc3cb
Merge pull request #95613 from timothyqiu/split-empty
Fix `split_floats` behavior when spaces are used as separators
2024-08-16 14:36:40 +02:00
Rémi Verschelde
f01e052162
Merge pull request #95549 from timothyqiu/split-translation-server
Split `TranslationServer` into its own file
2024-08-16 14:36:16 +02:00
Rémi Verschelde
1d4303c1fe
Merge pull request #95502 from bruvzg/net_ext_detect
[.NET] Move search in files extension list definition to be after Scene level module init.
2024-08-16 14:35:12 +02:00
Rémi Verschelde
69db19f058
Merge pull request #94826 from Naros/classdb-expose-property-getter-setter
Expose ClassDB methods `get_property_setter` / `get_property_getter`
2024-08-16 14:32:32 +02:00
Rémi Verschelde
6042c66663
Merge pull request #94720 from noidexe/fix-gamepad-triggers
Fix gamepad triggers not working on web exports
2024-08-16 14:32:27 +02:00
Haoyu Qiu
f483c3aafa Fix split_floats behavior when spaces are used as separators 2024-08-16 17:30:44 +08:00
Rémi Verschelde
ae2044dccb
Merge pull request #95477 from RandomShaper/res_load_dev_bugs
ResourceLoader: Use better error handling for possible engine bugs
2024-08-16 10:36:33 +02:00
Rémi Verschelde
f1d6677713
Merge pull request #95469 from bruvzg/cowdata_unref
`CowData` remove hardcoded offset and unused argument from `_unref`.
2024-08-16 10:36:28 +02:00
Rémi Verschelde
886d5865a4
Merge pull request #95291 from BlueCube3310/hdr-optimizations
Optimize .hdr loading and RGB9E5 conversion
2024-08-16 10:35:32 +02:00
Rémi Verschelde
a8bbb09bd5
Merge pull request #95143 from TV4Fun/fix_non_windows_library_load
Fix reload of GDExtension libraries in framework package on macOS
2024-08-16 10:35:19 +02:00
Rémi Verschelde
70096c0e6a
Merge pull request #94558 from stuartcarnie/sgc/sprintf_allocations
Reduce allocations in `String::sprintf`
2024-08-16 10:34:28 +02:00
Rémi Verschelde
91bf992168
Merge pull request #94353 from aaronp64/cowdata_insert
Improve `CowData::insert` performance
2024-08-16 10:34:22 +02:00
Rémi Verschelde
27f3dd8d01
Merge pull request #93149 from Malcolmnixon/smoothstep-degenerate-case
Handle the smoothstep degenerate case of empty range
2024-08-16 10:33:58 +02:00
Rémi Verschelde
71ca5aa5ec
Merge pull request #92555 from AThousandShips/insert_improve
[Core] Optimize `String::insert`
2024-08-16 10:33:47 +02:00
Rémi Verschelde
e057c49bf7
Merge pull request #92550 from AThousandShips/join_improve
[Core] Optimize `String::join`
2024-08-16 10:33:42 +02:00
Rémi Verschelde
46c6865979
Merge pull request #92391 from rburing/fti_3d
Physics interpolation (3D)
2024-08-16 10:33:37 +02:00
Rémi Verschelde
eb684cccdc
Merge pull request #92291 from BlueCube3310/image-convert-optimized
Optimize image conversion for half and float formats.
2024-08-16 10:33:32 +02:00
Malcolm Nixon
23fc704cbc This PR handles the smoothstep degenerate case where the range is empty.
It also updates the documentation to describe positive and negative ranges.

Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-Authored-By: kleonc <9283098+kleonc@users.noreply.github.com>
2024-08-15 19:08:05 -04:00
A Thousand Ships
e211d08c92
[Core] Optimize String::join
Avoid reallocation by pre-computing size
2024-08-15 16:19:07 +02:00
A Thousand Ships
746c6b87eb
[Core] Optimize String::insert 2024-08-15 16:18:47 +02:00
Haoyu Qiu
7343dc3a5d Split TranslationServer into its own file 2024-08-15 15:00:47 +08:00
Lisandro Lorea
9dd372f316 Fix gamepad triggers not working on web exports
Fixes #81758

DisplayServerWeb::process_joypads handles buttons 6 and 7 of the
HTML5 Standard Gamepad as a special case by doing:
`input->joy_axis(idx, (JoyAxis)b, s_btns[b]);`

This doesn't work because there is no JoyAxis 6 or 7 in the enum

To fix this we use JoyAxis::TRIGGER_LEFT and TRIGGER_RIGHT for button 6
and 7

However since we are now lying to input->joy_axis we also need to lie in
the mappings for the standard gamepad in godotcontrollersdb.txt,
otherwise input->joy_axis will try to find a mapping to axis 4(LT) and
axis 5(RT) that's not defined.

Therefore we set lefttrigger to +a4 and righttrigger to +a5 in the
mapping, to match what we are actually sending.

A cleaner, and more involved fix to this would be modifying
input->joy_button so that it can handle analog buttons and map them to
axes preserving their value instead of converting to boolean
2024-08-14 16:13:16 -03:00
bruvzg
69d52ed081
[.NET] Move search in files extension list definition to be after Scene level module init. 2024-08-14 00:16:09 +03:00
Pedro J. Estébanez
31a9e10ddb ResourceLoader: Use better error handling for possible engine bugs 2024-08-13 12:52:08 +02:00
Pedro J. Estébanez
17ea4b405a ResourceLoader: Fix error on querying progress for uncached loads 2024-08-13 12:41:11 +02:00
bruvzg
273ba27c2f
CowData remove hardcoded offset and unused argument from _unref. 2024-08-13 08:53:45 +03:00
BlueCube3310
80cf6cbfe9 Optimize .hdr loading and RGB9E5 conversion 2024-08-09 22:39:30 +02:00
Mikael Hermansson
613600fa89 Fix use-after-free in FileAccess::exists 2024-08-09 03:33:51 +02:00
Joel Croteau
f44d6a235f Fix reload of GDExtension libraries in framework package on macos
`GDExtension::open_library` has a check in it to see if the library was loaded
from a temp file, and if it was to restore the original name as that is the one
we actually care about. This check is breaking extension reloading on Mac when
the library path is to a framework folder, as the file inside the framework
will not generally be the same name as the folder.

This check also shouldn't be necessary even on Windows, which is the only
platform that uses `generate_temp_files`, since disposal of the created temp
file is handled within `OS_Windows::open_dynamic_library`, and
`GDExtension::open_library` (which is the only function to call
`open_dynamic_library` with a `p_data` argument) only cares about the original
library file path and has to do extra work to remove the name of the temp file.
Instead, I have removed that check and set `OS_Windows::open_dynamic_library`
to return the name of the original file and not the name of the copy.

This fixes GDExtension reloading on macOS. I do not have a Windows machine
available to test that it still works properly on Windows, so someone should
check that before merging this.
2024-08-08 08:31:49 -06:00
bruvzg
f5bb14dceb
[ResourceLoader] Add check to prevent double free crashes. 2024-08-06 08:31:03 +03:00
Hilderin
1ed723bd19 Fix global class cache file not present when no class name 2024-07-31 16:57:25 -04:00
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
Chris Cranford
7963e63165 Expose ClassDB methods get_property_setter / get_property_getter 2024-07-27 00:13:34 -04: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
Stuart Carnie
67eb6bed2b
use operator += (char32_t)
This prevents an allocation of a new string for every character.

Additionally, use some static constants for padding and sign characters
2024-07-25 09:17:58 +10: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