1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00
Commit Graph

1178 Commits

Author SHA1 Message Date
HP van Braam
cccd2432c3 Refactor CommandQueueMT to use vararg templates
In order to make CommandQueueMT more maintainable this PR changes the
previous macro hell with variadic templates instead. This makes the
class far more explicit and will allow us to more easily change the way
the class functions in the future.

Furthermore this refactoring has allowed for some optimizations. In
particular by using std::forward to delay the decision of decaying the
type to as late as possible we are able to move the data from the
callsite into our Command buffer and later move it to the call.

In practice what this means is that compared to the old version instead
of copying values 3 times, we can now get away with 1 copy, and 1 move
for lvalues, and just 2 moves for rvalues. This saves quite a few
operations in a hot codepath.

We also now test to make sure that the amount of copies and moves are
what we expect. This way we can spot performance regressions in this
code easily.

Somewhat unscientifically, running TPS-demo by pressing enter and not
touching the controls average mspf, repeatable across many runs:

before: 6.467
after : 6.202
2025-01-02 15:35:08 +01:00
Silc Lizard (Tokage) Renew
d0c421976c Fix looking at with 180 degree arc
Co-authored-by: Fruitsalad <949631+fruitsalad@users.noreply.github.com>
2025-01-02 15:47:01 +09:00
AThousandShips
25ecf5ec83 [Core] Fix UID encoding
Fixes edge case where `0` encoded as `uid://` instead of `uid://a`, and
fixes the size of the temporary buffer storing encoded UID strings.
2024-12-31 15:20:09 +01:00
Jan Haller
df66ea74d7 Fix NodePath::slice() incorrect behavior for subname indexing
Adjust slice boundaries in `NodePath` logic to correctly handle subnames.
Update test cases to reflect these changes.
2024-12-30 21:22:26 +01:00
Thaddeus Crews
a9b6b3d932 Merge pull request #100776 from AThousandShips/improve_null_checks
Improve use of `Ref.is_null/valid`
2024-12-29 09:35:04 -06:00
Hendrik Brucker
16233db6bf Ensure that directory exists in create_test.py 2024-12-28 01:39:09 +01:00
A Thousand Ships
a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
Thaddeus Crews
08d4dd7fd8 Merge pull request #100694 from Ivorforce/cowdata-destruct-graciously
Destruct `CowData` more graciously by avoiding accidentally exposing a half-destructed buffer.
2024-12-23 11:15:18 -06:00
smix8
d51615b334 Change navigation map synchronization to an async process
Changes the navigation map synchronization to an async process to avoid stalling the main thread.
2024-12-22 02:03:59 +01:00
Lukas Tenbrink
25cd923ea1 Destruct CowData more graciously by avoiding accidentally exposing a half-destructed buffer. This can avoid problems if any of the destructed objects tries to access the data while it's being destructed. 2024-12-21 20:01:03 +01:00
Rémi Verschelde
dac0b67c4d Merge pull request #100659 from clayjohn/color-srgb-precision
Increase precision in `linear_to_srgb()` and `srgb_to_linear()`
2024-12-20 23:57:35 +01:00
Rémi Verschelde
87855e04ad Merge pull request #100643 from ze2j/follow_up_of_array_mesh_surface_remove
Follow-up of `ArrayMesh::surface_remove` addition
2024-12-20 23:57:20 +01:00
Rémi Verschelde
a11364d1e6 Merge pull request #99010 from Hilderin/embedding-game-process
Embed game process in editor
2024-12-20 23:56:43 +01:00
clayjohn
46ce499b6f Increase precision in linear_to_srgb and srgb_to_linear
This avoids the situation where white stops being white after conversion. While maintaining as much floating point ops as possible
2024-12-20 10:49:43 -07:00
ze2j
97b093617d Follow-up of ArrayMesh::surface_remove addition 2024-12-20 10:53:43 +01:00
Thaddeus Crews
b715fabd70 Merge pull request #76371 from ze2j/array_mesh_surface_remove
Add `ArrayMesh::surface_remove`
2024-12-19 19:59:56 -06:00
Thaddeus Crews
361e3b4fe8 Core: Expand std::initializer_list support 2024-12-18 18:46:59 -06:00
Hilderin
9d2a4c03be Embedding game process in editor 2024-12-18 17:52:42 -05: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
kit
63a90b3dd8 Add tests for SplitContainer 2024-12-17 18:16:52 -05:00
Rémi Verschelde
0ce9e3e941 Merge pull request #98504 from timothyqiu/test-keyevent-rtr
Fix `InputEventKey` test failure under certain system languages
2024-12-17 16:18:46 +01:00
Pāvels Nadtočajevs
7c182a1544 [TextServer] Fix space trimming around mandatory line breaks. 2024-12-16 23:37:26 +02:00
Kiro
e4f8a7f8cf improveParseUTF8Performance 2024-12-16 09:55:11 +01:00
Thaddeus Crews
2b41a217d2 Merge pull request #100259 from Sauermann/proposal-right-click-cancel-drag
Allow canceling drag-and-drop with right mouse button
2024-12-11 17:35:39 -06:00
Rémi Verschelde
c2e4ae782a Merge pull request #100235 from akien-mga/revert-97303
Revert "Avoid duplicating signals from scene instances into packed scenes"
2024-12-11 18:48:18 +01:00
Markus Sauermann
4d6a6b21e2 Allow canceling drag-and-drop with right mouse button
This is a small usability enhancement, that allows users to cancel
drag-and-drop without the need to press the escape key on the keyboard.
2024-12-11 00:13:54 +01:00
Thaddeus Crews
8f16f864a6 Merge pull request #99765 from dalexeev/core-fix-json-from-to-native
Core: Fix `JSON.{from,to}_native()` issues
2024-12-10 14:15:53 -06: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
Thaddeus Crews
4b1a51d3e3 Merge pull request #100075 from demolke/simplify
Fix handling of leading `..` in simplify_path
2024-12-09 14:33:34 -06:00
Thaddeus Crews
e06f699354 Merge pull request #99886 from ZhiyiHu93/update-sky-tests
Add unit tests for Sky
2024-12-09 14:33:20 -06:00
Fabio Alessandrelli
e5807b2adf [Net] Fix TCP/UDP server network tests
Some tests have been removed since there's no way to guarantee they will
pass.

Other tests have been refactored to ensure proper waiting, and taking
into account potential out-of-order delivery (which is unlikely in test
scenarios but expecting a specific order on a UDP socket is wrong and
OSes makes no promises of ordered delivery on localhost).
2024-12-06 18:00:49 +01:00
Zhiyi Hu
1e62c7f53e Add unit tests to Sky 2024-12-06 10:31:17 -05:00
Rémi Verschelde
aa8d9b83f6 Merge pull request #99960 from pafuent/fixing_tcp_server_flappy_disconnect_test
Fix `TCPServer` "Should disconnect client" test
2024-12-06 16:16:17 +01:00
demolke
964e2b3a9e Fix handling of leading .. in simplify_path
Prior to this `..\..\texture.png` was incorrectly simplified to `texture.png`
2024-12-06 07:53:55 +01:00
Thaddeus Crews
30b32396de Merge pull request #100053 from bruvzg/font_change
Change default Arabic font to Vazirmatn.
2024-12-05 14:12:14 -06:00
Pāvels Nadtočajevs
06cae04b87 Change default Arabic font to Vazirmatn. 2024-12-05 16:26:52 +02:00
DeeJayLSP
eaa0418deb TestAudioStreamWAV: use runtime load instead of importer 2024-12-04 18:44:48 -03:00
Pablo Andres Fuente
df2c2ca3c3 Fix TCPServer "Should disconnect client" test
"Should disconnect client" test was failing randomly on Mac CI tests, so
this PR is making it more reliable reading on the closed client instead of
writing to it
2024-12-03 09:46:37 -03:00
demolke
35bb827d10 Destroy EditorFilesystem/EditorSettings on test shutdown
Otherwise asan complains if a test tries to use these.

Split off from https://github.com/godotengine/godot/pull/98909
2024-12-02 19:34:39 +01:00
Rémi Verschelde
5836a24a1c Merge pull request #99488 from bruvzg/te_brk_cases
[TextServer] Fix some line breaking edge cases.
2024-12-02 17:20:15 +01:00
Rémi Verschelde
90087476a3 Merge pull request #99726 from smix8/path_simply_test
Add test for NavigationServer path simplification
2024-12-02 15:51:25 +01:00
Rémi Verschelde
9048776457 Merge pull request #99751 from bruvzg/dir_init
Add `std::initializer_list` constructor for Dictionary.
2024-11-29 22:51:17 +01:00
Rémi Verschelde
8d3fc48abf Merge pull request #97521 from pafuent/enhance_scroll_container_focus
Add a focus border on `ScrollContainer`
2024-11-29 22:46:09 +01:00
Rémi Verschelde
5d462ee4c5 Merge pull request #67857 from anvilfolk/extended-curve
Extend Curve to allow for domains outside of [0, 1].
2024-11-29 22:45:19 +01:00
Rémi Verschelde
bcb5f8377f Merge pull request #99125 from Flarkk/projection_tests
Add tests for `Projection`
2024-11-29 22:01:59 +01:00
Rémi Verschelde
94082a424b Merge pull request #97303 from cixil/fix-duplicate-signal-bug
Avoid duplicating signals from scene instances into packed scenes
2024-11-29 22:01:51 +01:00
cixil
8a42e3d3ef Avoid duplicating signals from scene instances into packed scenes 2024-11-29 18:29:08 +01:00
Pāvels Nadtočajevs
54945c4d28 Add std::initializer_list constructor for Dictionary. 2024-11-29 14:12:40 +02:00
Pablo Andres Fuente
0c03db09f8 Add unit tests for TCPServer
This PR aims to help "fix" #43440
2024-11-29 12:55:49 +01:00