Commit Graph

69998 Commits

Author SHA1 Message Date
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
b9437c3938 Merge pull request #100382 from hpvb/thirdparty-ubsan-tpsdemo
Add thirdparty/ ubsan suppressions for TPS demo
2024-12-14 19:47:28 +01:00
863a24ac86 Merge pull request #100405 from BlueCube3310/bcdec-fix-v200
bcdec: Fix logic for detecting incomplete blocks
2024-12-14 18:25:49 +01:00
ffe53cba3c Merge pull request #100374 from hpvb/fix-rendering-ubsan
Fix ubsan reported errors in rendering
2024-12-14 18:25:46 +01:00
68559c4906 Merge pull request #100367 from Ivorforce/swap-move
Optimize `SWAP` macro by using move semantics.
2024-12-14 18:25:42 +01:00
736dcf72cc Merge pull request #100125 from alessand10/uniform-variable-fix
Move uniform variables up in the `gles3/scene.glsl` template so that they are available within the `#GLOBALS` scope
2024-12-14 18:25:38 +01:00
e0cdba40fd Merge pull request #99453 from reach-satori/drag_to_filesystem_folder
Allow dragging to specific folders in filesystem dock
2024-12-14 18:25:33 +01:00
ffe0cdebab Merge pull request #99355 from havi05/itemlist-toggle-mode
Add `Toggle` selection mode to `ItemList`
2024-12-14 18:25:25 +01:00
e271b2ca08 Merge pull request #99145 from dsnopek/xr-lock-camera
XR: Allow locking the camera to the `XROrigin3D` for benchmarking or automated testing
2024-12-14 18:25:21 +01:00
66a2ea4718 Merge pull request #98610 from Flarkk/fix_sphere_capsule
Fix normals of very large `SphereMesh` and `CapsuleMesh`
2024-12-14 18:25:17 +01:00
36c6ce92db Merge pull request #97660 from HolonProduction/completion-cancelation-🌈
GUI: Only cancel completion with the `ui_cancel` action
2024-12-14 18:25:13 +01:00
20064cf5c0 Merge pull request #95044 from Hilderin/fix-double-click-signal-connection
Fix connecting a signal with a double click is too difficult
2024-12-14 18:25:07 +01:00
f7f2361fa8 Merge pull request #90057 from ryevdokimov/fix-inherit2
Add ability to create a new inherited scene from code
2024-12-14 18:25:01 +01:00
8f9673eeff bcdec: Fix logic for detecting incomplete blocks 2024-12-14 17:57:44 +01:00
4e19ab8afe Fix connecting a signal with a double click is too difficult
Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
2024-12-14 16:18:34 +03:00
49a19db0e0 Add thirdparty/ ubsan suppressions for TPS demo
With these suppressions it is possible to import and run the TPS demo
without any thirdparty/ reported ubsan.

This is useful because it is a complex project, so it is good for
testing if new errors show up in our own code.
2024-12-14 00:41:52 +01:00
dc5f1b7a28 Merge pull request #100319 from Flarkk/fix_light_shadow_range
Fix shadows of long range `OmniLight3D` and `SpotLight3D`
2024-12-13 16:19:39 -06:00
3e3a013f9a Merge pull request #100380 from hpvb/thirdparty-ubsan
Exclude known thirdparty/ ubsan errors
2024-12-13 16:19:38 -06:00
9ecdeb3723 Merge pull request #98747 from tetrapod00/standardize-renderer-strings
Standardize terms for renderers in error strings
2024-12-13 16:19:37 -06:00
b68675e518 Merge pull request #100342 from mihe/jolt/thread-safe-rids
Make `RID` allocation thread-safe when using Jolt Physics
2024-12-13 16:19:35 -06:00
6594a6364e Merge pull request #100213 from DarioSamo/pipeline-hash-map-thread-safety
Improve thread-safety of pipeline hash map.
2024-12-13 16:19:34 -06:00
c58fbaf751 Merge pull request #100340 from smix8/csg_3d_child_notify
Fix 3D CSG not reacting to child node order changes
2024-12-13 16:19:33 -06:00
9535cd064f Merge pull request #97810 from pafuent/getting_ccache_working_on_mac
Improve detection of ccache on macOS
2024-12-13 16:19:32 -06:00
244f7931d2 Merge pull request #100369 from Calinou/doc-gpuparticles-emit-subparticle
Document `GPUParticles.emit_particle()` only working on Forward+ and Mobile
2024-12-13 16:19:31 -06:00
3c6896fd2a Merge pull request #99181 from GuilhermeGSousa/animation-node-extension
Add animation node extension
2024-12-13 16:19:30 -06:00
28c02a8491 Merge pull request #100334 from Sauermann/fix-editor-shortcut-reconversion
Introduce a conversion for editor shortcuts
2024-12-13 16:19:28 -06:00
d7e4b9e31b Merge pull request #95660 from Meorge/remove-texturebutton-needs-normal-texture
Remove incorrect statement about TextureButton normal texture
2024-12-13 16:19:27 -06:00
9f0c6231c7 Merge pull request #100236 from Flarkk/fix_spot_clustering
Fix wide `SpotLight3D` clustering
2024-12-13 16:19:26 -06:00
5527bcbfbe Merge pull request #100363 from RandomShaper/fix_mtl_mt_deadlock_4.4
Fix deadlock possibility in threaded load of materials
2024-12-13 16:19:24 -06:00
f2c8f17906 Merge pull request #100325 from hpvb/fix-rendering-alignment
Fix several ubsan reported misaligned accesses
2024-12-13 16:19:20 -06:00
80ae6fc1ee Merge pull request #100324 from YYF233333/codestyle
Remove dead code in `AnimationNodeStateMachine`
2024-12-13 16:19:18 -06:00
70dbc311d1 Exclude known thirdparty/ ubsan errors
In my quest to make ubsan failures a build failure I've added all
current ubsan errors by type to a new suppression file which we will
then also use with CI.

The idea is to only add known ubsan errors to this file, so this is not
a blanket exclusion of thirdparty/ this means that if we get new or
unexpected ubsan in thirdparty/ builds would fail.
2024-12-13 23:11:35 +01:00
062d74bb9c Fix ubsan reported errors in rendering
This allows the TPS demo to run without an ubsan reports from any of the
rendering code.
2024-12-13 21:27:37 +01:00
49ca40cdbf Document GPUParticles.emit_particle() only working on Forward+ and Mobile 2024-12-13 16:41:41 +01:00
383d933f53 Optimize SWAP macro by using move semantics. 2024-12-13 16:19:52 +01:00
e674379764 Fix several ubsan reported misaligned accesses
These misaligned accesses are shown in all of our CI hooks. It turned
out to not be difficult to fix.

It is likely that this will improve performance for aarch64.
2024-12-13 15:32:35 +01:00
7f5c469292 Merge pull request #92131 from paulloz/net8
C#: Move GodotSharp to .NET8
2024-12-13 15:31:59 +01:00
fb8553e4d7 Move to .NET8
- Change TFM and LangVersion
- Better exception throwing (CA1510, CA1512, CA1513)
- Better exception utility method definition (CA1859)
- Prefer comparing `.Count` over calling `.Any()` (CA1860)
- Prefer `.AsSpan()` over `.Substring()` (CA1846)
- Add a few more `scoped`
- Use `RuntimeHelpers.GetUninitializedObject()` instead of `FormatterServices.GetUninitializedObject()`
- Use delegate instead of delegate pointer in variant generic conversions
- Enable EnforceExtendedAnalyzerRules in source generator projects
- Disable CS8981 on structs named movable in Godot.NativeInterop
2024-12-13 14:00:13 +01:00
7c4c1100e0 Improving detection of ccache on Mac
Before this commit, ccache where only used on Mac when
`OSXCROSS_ROOT` was defined. Now, it could be used even
when that envirnment variable is not defined.
2024-12-13 09:50:27 -03:00
4bfc6f8d70 Fix deadlock possibility in threaded load of materials 2024-12-13 12:49:10 +01:00
02f05cf0ac Fix wide angle spotlight clustering 2024-12-13 11:28:42 +01:00
691d8bee2b Merge pull request #100344 from clayjohn/refprobe-blend
Small fixups for the new reflection probe blending
2024-12-13 09:48:50 +01:00
4c34813b32 Fix very large radius SphereMesh and CapsuleMesh normals 2024-12-13 09:26:59 +01:00
356fa37f89 Small fixups for the new reflection probe blending 2024-12-12 17:29:21 -08:00
f6126badba Make RID allocation thread-safe when using Jolt Physics 2024-12-13 00:39:42 +01:00
46c9089ddc Remove incorrect statement that TextureButton needs a texture for normal state in docs
Update doc/classes/TextureButton.xml

Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>

Improve explanation of texture fallback behaviors for TextureButton

Remove a bit of incorrect information from TextureButton documentation

Most other state textures are not overlaid (only `texture_focused`)

Apply suggestions from code review
2024-12-12 15:34:38 -08:00
20c519d0fa Fix 3D CSG not reacting to child node order changes
Fixes 3D CSG not reacting to child node order changes.
2024-12-13 00:28:42 +01:00
ba2c5c1e61 Merge pull request #100318 from dsnopek/stream-peer-extension-put-partial-data-bug
Fix `StreamPeerExtension::put_partial_data()` to call `_put_partial_data()`
2024-12-12 16:13:38 -06:00
c34a3f1ed2 Merge pull request #100059 from Calinou/editor-default-enable-emulate-numpad
Enable Emulate Numpad by default in the 3D editor settings
2024-12-12 16:13:37 -06:00
bfc66f0608 Merge pull request #100282 from devloglogan/motion-vectors-openxr
Add renderer motion vectors API for use with OpenXR
2024-12-12 16:13:36 -06:00