1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00
Commit Graph

804 Commits

Author SHA1 Message Date
Thaddeus Crews
768d75a248 Merge pull request #101254 from mihe/jolt/better-settings
Refactor Jolt-related project settings to only be loaded as needed
2025-03-13 08:57:43 -05:00
Konrad Gadzina
e6f812c056 Modify color in ColorPicker with keyboard or joypad 2025-03-11 22:41:41 +01:00
Thaddeus Crews
56bc9bc2f4 Merge pull request #102984 from syntaxerror247/volume-buttons
Android: enable support for volume button events
2025-03-11 09:34:46 -05:00
Adam Scott
1d325847f3 Revert "Add built-in GUI to display license notices"
This reverts commit daa6198925.
2025-03-10 10:33:12 -04:00
Thaddeus Crews
0c6efe572e Merge pull request #79599 from Calinou/add-license-notices-gui
Add built-in GUI to display license notices
2025-03-07 15:12:29 -06:00
Pāvels Nadtočajevs
1866988724 [Docs] Fix WorkerThreadPool wrong max thread value description. 2025-03-06 17:06:10 +02:00
Hugo Locurcio
39cb5a92f0 Document Glow Upscale Mode project setting only affecting Forward+/Mobile 2025-03-03 20:53:44 +01:00
Anish Mishra
5ce16dfc69 Android: enable support for volume button events
- Enable events KEY_VOLUMEUP and KEY_VOLUMEDOWN on Android.

- Adds a project setting to override volume buttons. It would disable system volume changes when the buttons are used within the project.
2025-02-28 09:47:22 +05:30
Rémi Verschelde
39c201ca58 Merge pull request #103247 from Faless/mbedtls/backport_defragment_tls_handshake
[mbedTLS] Integrate TLS handshake defragmentation PR
2025-02-24 17:33:35 +01:00
Fabio Alessandrelli
fe84b84b51 [mbedTLS] Enable TLS 1.3 negotiation by default 2025-02-24 14:04:09 +01:00
Rémi Verschelde
b77423370a Fix cross-platform configuration of rendering driver settings
Simpler alternative to #103026 which avoids breaking compatibility.

Instead of introducing a new `auto` default value, we ensure that all
supported drivers are registered regardless of the editor's host platform,
and that the defaults are the intended ones.

This solves the following issues:
- macOS exports are meant to default to Metal in 4.4, but they would
  default to Vulkan if exported from Linux, Windows, or Android editors.
- Windows exports couldn't be made with Direct3D 12 from Linux, macOS, or
  Android editors, as the option couldn't be selected outside Windows.

Unlike #103026, it doesn't solve the issue of not always saving the
rendering drivers to `project.godot`, but now the defaults are at least
consistent between editor platforms.

Co-authored-by: Pāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com>
2025-02-23 12:28:59 +01:00
Rémi Verschelde
11f56d8265 Revert "Always allow selecting any rendering driver in the settings, add "auto" option."
This reverts commit dea20c4a9b.

This had unforeseen consequences for editor code that relies on querying these settings,
and possibly thirdparty code that would do the same. In hindsight, it's a bit too late
in the release cycle to make such a compatibility breaking change.
2025-02-23 12:19:20 +01:00
Rémi Verschelde
413b7941f3 Merge pull request #103026 from bruvzg/drv_names
Always allow selecting any rendering driver in the settings, add "auto" option.
2025-02-20 16:51:54 +01:00
Pāvels Nadtočajevs
dea20c4a9b Always allow selecting any rendering driver in the settings, add "auto" option. 2025-02-19 12:05:04 +02:00
Rémi Verschelde
5f8b5a34c6 mbedtls: Don't set TLS max version on Mbed TLS < 3.0
Relevant for Linux distribution packages which may link against system Mbed TLS.

Fixes #102957.
2025-02-17 17:51:15 +01:00
Fabio Alessandrelli
488cdbacdb [TLS] Disable TLSv1.3 support by default 2025-02-14 18:06:46 +01:00
bruvzg
3f2a29cd9d [Windows] Read Wacom config to check if Windows Ink is disabled and auto switch to WinTab. 2025-02-13 15:10:16 +02:00
Hugo Locurcio
e05f0a45f6 Improve documentation on forcing right-to-left layout in Control 2025-02-12 02:20:31 +01:00
Rémi Verschelde
9ac02ccbcb Merge pull request #102726 from mihe/jolt/thread-safe-errors
Skip `Object::to_string` when Jolt Physics is on separate thread
2025-02-11 23:59:40 +01:00
Rémi Verschelde
4f137bb1ad Merge pull request #102716 from Calinou/doc-control-layout-direction
Clarify the behavior of `Control.layout_direction` in the documentation
2025-02-11 23:59:33 +01:00
Mikael Hermansson
1006fa9c42 Skip Object::to_string when Jolt Physics is on separate thread 2025-02-11 22:55:32 +01:00
Hugo Locurcio
65c795eb35 Clarify the behavior of Control.layout_direction in the documentation 2025-02-11 16:56:22 +01:00
Pāvels Nadtočajevs
3965bdfd62 [AudioStreamGenerator] Add mixing rate presets, update docs. 2025-02-11 11:22:34 +02:00
SheepYhangCN
c0eec97e98 macOS: Implement fallback from Metal to Vulkan for x86_64 2025-02-10 13:23:46 +01:00
Hugo Locurcio
0c4834b20f Decrease default Max Rays per Pass setting to 4 to fix some lightmapping crashes 2025-02-06 14:36:23 +01:00
Hilderin
f601117c74 Fix Embed Game not available when multi window is disabled 2025-01-31 07:56:54 -05:00
Hugo Locurcio
daa6198925 Add built-in GUI to display license notices
Press Ctrl/Cmd + Shift + L (`ui_toggle_licenses_dialog` built-in action)
to show/hide the notices dialog.

The dialog can be shown via script using
`SceneTree.licenses_dialog_visible = true|false`.

Co-authored-by: MewPurPur <mew.pur.pur@abv.bg>
2025-01-27 18:35:04 +01:00
Mikael Hermansson
3b78ff564a Refactor Jolt-related project settings to only be loaded as needed 2025-01-25 12:18:52 +01:00
Thaddeus Crews
ec85334a84 Merge pull request #90425 from tracefree/load-pack-fix
Fix "res://" being replaced by resource packs in the editor and on Android
2025-01-16 17:18:02 -06:00
Rie
d17ce4c37e Fix "res://" being replaced by resource packs in the editor and on Android 2025-01-15 11:20:46 +01:00
Hugo Locurcio
e668188c64 Document WorldBoundaryShape3D having a finite size when using Jolt Physics
This also mentions Jolt Physics in the ProjectSettings 3D physics engine
documentation.
2025-01-14 22:21:11 +01:00
Danil Alexeev
cd918ff470 GDScript: Remove RENAMED_IN_GODOT_4_HINT from GDScriptWarning::Code enum 2025-01-09 21:07:41 +03:00
Mikael Hermansson
d6b822c891 Cache value of Jolt Physics project setting bounce_velocity_threshold 2025-01-07 18:35:04 +01:00
Rémi Verschelde
f92780204e Merge pull request #101166 from jss2a98aj/opengl3-fallback-wording
Improve OpenGL 3 fallback documentation wording
2025-01-06 22:49:22 +01:00
jss2a98aj
e9c1c44be2 Fix OpenGL 3 fallback wording
It should not say "both" where there are three APIs listed.
2025-01-06 10:58:22 -05:00
Stuart Carnie
11dc4f2e5e Metal: Add MetalFX upscaling support
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-01-06 06:03:18 -07: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
Thaddeus Crews
2fcd8223e8 Merge pull request #99538 from Geometror/lightmap-gi-transparent-surface
Add transparency support for LightmapGI
2024-12-19 19:59:52 -06:00
Hendrik Brucker
a3525bc015 Add transparency support for LightmapGI
Co-authored-by: Guerro323 <kaltobattle@gmail.com>
2024-12-18 19:36:16 +01:00
Rémi Verschelde
d60c0e21a6 Merge pull request #88313 from wagnerfs/run-time-anisotropic-filtering
Allow changing the anisotropic filter level at run-time per Viewport
2024-12-17 16:18:38 +01:00
Rémi Verschelde
d1b683d413 Merge pull request #97140 from BastiaanOlij/xr_action_map_enhancements
OpenXR: Add support for binding modifiers
2024-12-12 14:09:41 +01:00
Thaddeus Crews
153ef23483 Merge pull request #100129 from smix8/pathunspaghettification
Despaghettify NavigationServer path queries
2024-12-11 17:35:38 -06:00
Thaddeus Crews
c5e6f6276b Merge pull request #100110 from DarioSamo/rd-get-data-async
Implement `RD::buffer_get_data_async()` and `RD::texture_get_data_async()`
2024-12-11 17:35:29 -06:00
Bastiaan Olij
0a61ebdcea OpenXR: Add support for binding modifiers 2024-12-12 09:46:19 +11:00
smix8
476479419b Despaghettify NavigationServer path queries
Despaghettify NavigationServer path queries.
2024-12-11 22:29:48 +01:00
Dario
054891de04 Implement buffer_get_data_async and texture_get_data_async. 2024-12-11 11:55:23 -08:00
Rémi Verschelde
44dfa7e710 Merge pull request #99895 from mihe/jolt-physics
Add Jolt Physics as an alternative 3D physics engine
2024-12-11 14:53:57 +01:00
Mikael Hermansson
d470c2ac6a Add Jolt Physics as an alternative 3D physics engine
Co-authored-by: Jorrit Rouwe <jrouwe@gmail.com>
2024-12-11 13:57:25 +01:00
Thaddeus Crews
66dea152b5 Merge pull request #99257 from darksylinc/matias-TheForge-pr04-excluded-ubo+render_opt
Improvements from TheForge
2024-12-10 14:15:55 -06:00
Matias N. Goldberg
c77cbf096b Improvements from TheForge (see description)
The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.

This is the most "risky" PR so far because the previous ones have been
miscellaneous stuff aimed at either [improve
debugging](https://github.com/godotengine/godot/pull/90993) (e.g. device
lost), [improve Android
experience](https://github.com/godotengine/godot/pull/96439) (add Swappy
for better Frame Pacing + Pre-Transformed Swapchains for slightly better
performance), or harmless [ASTC
improvements](https://github.com/godotengine/godot/pull/96045) (better
performance by simply toggling a feature when available).

However this PR contains larger modifications aimed at improving
performance or reducing memory fragmentation. With greater
modifications, come greater risks of bugs or breakage.

Changes introduced by this PR:

TBDR GPUs (e.g. most of Android + iOS + M1 Apple) support rendering to
Render Targets that are not backed by actual GPU memory (everything
stays in cache). This works as long as load action isn't `LOAD`, and
store action must be `DONT_CARE`. This saves VRAM (it also makes
painfully obvious when a mistake introduces a performance regression).
Of particular usefulness is when doing MSAA and keeping the raw MSAA
content is not necessary.

Some GPUs get faster when the sampler settings are hard-coded into the
GLSL shaders (instead of being dynamically bound at runtime). This
required changes to the GLSL shaders, PSO creation routines, Descriptor
creation routines, and Descriptor binding routines.

 - `bool immutable_samplers_enabled = true`

Setting it to false enforces the old behavior. Useful for debugging bugs
and regressions.

Immutable samplers requires that the samplers stay... immutable, hence
this boolean is useful if the promise gets broken. We might want to turn
this into a `GLOBAL_DEF` setting.

Instead of creating dozen/hundreds/thousands of `VkDescriptorSet` every
frame that need to be freed individually when they are no longer needed,
they all get freed at once by resetting the whole pool. Once the whole
pool is no longer in use by the GPU, it gets reset and its memory
recycled. Descriptor sets that are created to be kept around for longer
or forever (i.e. not created and freed within the same frame) **must
not** use linear pools. There may be more than one pool per frame. How
many pools per frame Godot ends up with depends on its capacity, and
that is controlled by
`rendering/rendering_device/vulkan/max_descriptors_per_pool`.

- **Possible improvement for later:** It should be possible for Godot
to adapt to how many descriptors per pool are needed on a per-key basis
(i.e. grow their capacity like `std::vector` does) after rendering a few
frames; which would be better than the current solution of having a
single global value for all pools (`max_descriptors_per_pool`) that the
user needs to tweak.

 - `bool linear_descriptor_pools_enabled = true`

Setting it to false enforces the old behavior. Useful for debugging bugs
and regressions.
Setting it to false is required when workarounding driver bugs (e.g.
Adreno 730).

A ridiculous optimization. Ridiculous because the original code
should've done this in the first place. Previously Godot was doing the
following:

  1. Create a command buffer **pool**. One per frame.
  2. Create multiple command buffers from the pool in point 1.
3. Call `vkBeginCommandBuffer` on the cmd buffer in point 2. This
resets the cmd buffer because Godot requests the
`VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT` flag.
  4. Add commands to the cmd buffers from point 2.
  5. Submit those commands.
6. On frame N + 2, recycle the buffer pool and cmd buffers from pt 1 &
2, and repeat from step 3.

The problem here is that step 3 resets each command buffer individually.
Initially Godot used to have 1 cmd buffer per pool, thus the impact is
very low.

But not anymore (specially with Adreno workarounds to force splitting
compute dispatches into a new cmd buffer, more on this later). However
Godot keeps around a very low amount of command buffers per frame.

The recommended method is to reset the whole pool, to reset all cmd
buffers at once. Hence the new steps would be:

  1. Create a command buffer **pool**. One per frame.
  2. Create multiple command buffers from the pool in point 1.
3. Call `vkBeginCommandBuffer` on the cmd buffer in point 2, which is
already reset/empty (see step 6).
  4. Add commands to the cmd buffers from point 2.
  5. Submit those commands.
6. On frame N + 2, recycle the buffer pool and cmd buffers from pt 1 &
2, call `vkResetCommandPool` and repeat from step 3.

**Possible issues:** @dariosamo added `transfer_worker` which creates a
command buffer pool:

```cpp
transfer_worker->command_pool =
driver->command_pool_create(transfer_queue_family,
RDD::COMMAND_BUFFER_TYPE_PRIMARY);
```

As expected, validation was complaining that command buffers were being
reused without being reset (that's good, we now know Validation Layers
will warn us of wrong use).
I fixed it by adding:

```cpp
void RenderingDevice::_wait_for_transfer_worker(TransferWorker
*p_transfer_worker) {
	driver->fence_wait(p_transfer_worker->command_fence);
	driver->command_pool_reset(p_transfer_worker->command_pool); //
! New line !
```

**Secondary cmd buffers are subject to the same issue but I didn't alter
them. I talked this with Dario and he is aware of this.**
Secondary cmd buffers are currently disabled due to other issues (it's
disabled on master).

 - `bool RenderingDeviceCommons::command_pool_reset_enabled`

Setting it to false enforces the old behavior. Useful for debugging bugs
and regressions.

There's no other reason for this boolean. Possibly once it becomes well
tested, the boolean could be removed entirely.

Adds `command_bind_render_uniform_sets` and
`add_draw_list_bind_uniform_sets` (+ compute variants).

It performs the same as `add_draw_list_bind_uniform_set` (notice
singular vs plural), but on multiple consecutive uniform sets, thus
reducing graph and draw call overhead.

 - `bool descriptor_set_batching = true;`

Setting it to false enforces the old behavior. Useful for debugging bugs
and regressions.

There's no other reason for this boolean. Possibly once it becomes well
tested, the boolean could be removed entirely.

Godot currently does the following:

 1. Fill the entire cmd buffer with commands.
 2. `submit()`
    - Wait with a semaphore for the swapchain.
- Trigger a semaphore to indicate when we're done (so the swapchain
can submit).
 3. `present()`

The optimization opportunity here is that 95% of Godot's rendering is
done offscreen.
Then a fullscreen pass copies everything to the swapchain. Godot doesn't
practically render directly to the swapchain.

The problem with this is that the GPU has to wait for the swapchain to
be released **to start anything**, when we could start *much earlier*.
Only the final blit pass must wait for the swapchain.

TheForge changed it to the following (more complicated, I'm simplifying
the idea):

 1. Fill the entire cmd buffer with commands.
 2. In `screen_prepare_for_drawing` do `submit()`
    - There are no semaphore waits for the swapchain.
    - Trigger a semaphore to indicate when we're done.
3. Fill a new cmd buffer that only does the final blit to the
swapchain.
 4. `submit()`
    - Wait with a semaphore for the submit() from step 2.
- Wait with a semaphore for the swapchain (so the swapchain can
submit).
- Trigger a semaphore to indicate when we're done (so the swapchain
can submit).
 5. `present()`

Dario discovered this problem independently while working on a different
platform.

**However TheForge's solution had to be rewritten from scratch:** The
complexity to achieve the solution was high and quite difficult to
maintain with the way Godot works now (after Übershaders PR).
But on the other hand, re-implementing the solution became much simpler
because Dario already had to do something similar: To fix an Adreno 730
driver bug, he had to implement splitting command buffers. **This is
exactly what we need!**. Thus it was re-written using this existing
functionality for a new purpose.

To achieve this, I added a new argument, `bool p_split_cmd_buffer`, to
`RenderingDeviceGraph::add_draw_list_begin`, which is only set to true
by `RenderingDevice::draw_list_begin_for_screen`.

The graph will split the draw list into its own command buffer.

 - `bool split_swapchain_into_its_own_cmd_buffer = true;`

Setting it to false enforces the old behavior. This might be necessary
for consoles which follow an alternate solution to the same problem.
If not, then we should consider removing it.

PR #90993 added `shader_destroy_modules()` but it was not actually in
use.

This PR adds several places where `shader_destroy_modules()` is called
after initialization to free up memory of SPIR-V structures that are no
longer needed.
2024-12-09 11:49:28 -03:00