Commit Graph

1459 Commits

Author SHA1 Message Date
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
23afda44e4
Merge pull request #100257 from darksylinc/matias-minimize-leak
Keep processing Graphics if there are pending operations
2024-12-11 17:35:35 -06:00
Bastiaan Olij
0a61ebdcea OpenXR: Add support for binding modifiers 2024-12-12 09:46:19 +11:00
Matias N. Goldberg
acf439e96d Keep processing Graphics if there are pending operations
Fixes #90017
Fixes #90030
Fixes #98044

This PR makes the following changes:

# Force processing of GPU commands for frame_count frames

The variable `frames_pending_resources_for_processing` is added to track
this.

The ticket #98044 suggested to use `_flush_and_stall_for_all_frames()`
while minimized.

Technically this works and is a viable solution.

However I noticed that this issue was happening because Logic/Physics
continue to work "business as usual" while minimized(\*). Only Graphics
was being deactivated (which caused commands to accumulate until window
is restored).

To continue this behavior of "business as usual", I decided that GPU
work should also "continue as usual" by buffering commands in a double
or triple buffer scheme until all commands are done processing (if they
ever stop coming). This is specially important if the app specifically
intends to keep processing while minimized.

Calling `_flush_and_stall_for_all_frames()` would fix the leak, but it
would make  Godot's behavior different while minimized vs while the
window is presenting.

\* `OS::add_frame_delay` _does_ consider being minimized, but it just
throttles CPU usage. Some platforms such as Android completely disable
processing because the higher level code stops being called when the app
goes into background. But this seems like an implementation-detail that
diverges from the rest of the platforms (e.g. Windows, Linux & macOS
continue to process while minimized).

# Rename p_swap_buffers for p_present

**This is potentially a breaking change** (if it actually breaks
anything, I ignore. But I strongly suspect it doesn't break anything).

"Swap Buffers" is a concept carried from OpenGL, where a frame is "done"
when `glSwapBuffers()` is called, which basically means "present to the
screen".

However it _also_ means that OpenGL internally swaps its internal
buffers in a double/triple buffer scheme (in Vulkan, we do that
ourselves and is tracked by `RenderingDevice::frame`).

Modern APIs like Vulkan differentiate between "submitting GPU work" and
"presenting".

Before this PR, calling `RendererCompositorRD::end_frame(false)` would
literally do nothing. This is often undesired and the cause of the leak.
After this PR, calling `RendererCompositorRD::end_frame(false)` will now
process commands, swap our internal buffers in a double/triple buffer
scheme **but avoid presenting to the screen**.

Hence the rename of the variable from `p_swap_buffers` to `p_present`
(which slightly alters its behavior).
If we want `RendererCompositorRD::end_frame(false)` to do nothing, then
we should not call it at all.

This PR reflects such change: When we're minimized **_and_**
`has_pending_resources_for_processing()` returns false, we don't call
`RendererCompositorRD::end_frame()` at all.

But if `has_pending_resources_for_processing()` returns true, we will
call it, but with `p_present = false` because we're minimized.

There's still the issue that Godot keeps processing work (logic,
scripts, physics) while minimized, which we shouldn't do by default. But
that's work for follow up PR.
2024-12-11 14:13:29 -03:00
Lukas Tenbrink
b5c31ebb41 Add contains_char() for single-character 'contains' calls. 2024-12-06 20:23:35 +01:00
Thaddeus Crews
a135a6478a
Merge pull request #98383 from RandomShaper/deprecate_unsafe_th_rend
Deprecate the pointless unsafe threading model for rendering
2024-12-03 14:40:56 -06:00
Thaddeus Crews
0045b1a513
Merge pull request #98862 from HuntJSparra/early-projsettings-registration
Register Engine, OS, ProjectSettings, and Time singletons in time for for `INITIZATION_LEVEL_CORE`
2024-11-26 13:04:51 -06:00
Thaddeus Crews
fd4bddbeaf Merge pull request #98946 from timothyqiu/3d-index
Remove unnecessary `_3D_DISABLED` checks in `Performance`
2024-11-22 14:54:08 -06:00
Hunt J. Sparra
48fbe4172b Register Engine, OS, ProjectSettings, and Time early. 2024-11-21 18:09:03 -05:00
Thaddeus Crews
0dda6a974c
Merge pull request #99286 from KoBeWi/uid_in_a_path_factory
Support uid:// in more places
2024-11-18 09:23:44 -06:00
A Thousand Ships
68f638cf02
Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
kobewi
3b6705a641 Support uid:// in more places 2024-11-16 21:43:18 +01:00
Rémi Verschelde
4d4407ce5a
Revert "Warn on unknown command line arguments"
This reverts commit 8379cc85aa.

This caused some regressions, as this approach doesn't properly handle all
possible arguments.
2024-11-15 21:48:51 +01:00
Pedro J. Estébanez
a46ea9d064 Deprecate the pointless unsafe threading model for rendering 2024-11-14 10:43:29 +01:00
Thaddeus Crews
15d09a5767
Merge pull request #99149 from mrsaturnsan/set_max_fps_fix
Fix max FPS initialization
2024-11-13 08:34:21 -06:00
mrsaturnsan
4b94162320 Fix max FPS initialization
Remove unnecessary get_max_fps
2024-11-12 21:10:27 -06:00
Thaddeus Crews
0a847f7464
Merge pull request #98253 from timothyqiu/its-too-late
Fix some strings not caught by editor pseudolocalization
2024-11-12 12:13:14 -06:00
Thaddeus Crews
972a5ca980
Merge pull request #98688 from timothyqiu/editor-only
Mark editor pseudolocalization CLI option editor-only
2024-11-11 14:17:55 -06:00
Haoyu Qiu
5f8df2ca63 Remove unnecessary _3D_DISABLED checks in Performance 2024-11-08 11:49:47 +08:00
Hugo Locurcio
8379cc85aa
Warn on unknown command line arguments
This eases troubleshooting when working with command line arguments.

Warnings are only printed if the argument does not exist as a file
or directory path (relative or absolute). This allows positional arguments
to keep working as they are now, without printing warnings when a project
reads positional arguments to perform operations on files (e.g. when
drag-and-dropping a file onto a project executable).

This now prints a warning:

    godot --non-existent-argument

This still doesn't print a warning, as it's an user argument:

    godot -- --non-existent-argument

This doesn't print a warning if the file/folder path exists:

    godot /path/to/file.txt

A warning is still printed if the file/folder doesn't exist. Drag-and-drop
associations always refer to existing files/folders, so that scenario was
unlikely to be encountered.
2024-11-06 15:01:40 +01:00
Haoyu Qiu
55c4e6979a Mark editor pseudolocalization CLI option editor-only 2024-10-31 09:36:49 +08:00
Thaddeus Crews
edad871a2d
Merge pull request #98425 from darksylinc/matias-breadcrumbs-race-fix
Fix race conditions in breadcrumbs
2024-10-25 13:04:12 -05:00
Thaddeus Crews
9554e3c35b
Merge pull request #38208 from Calinou/project-manager-use-dummy-audio-driver
Use the Dummy audio driver in the project manager
2024-10-25 13:04:02 -05:00
Matias N. Goldberg
668c9b74e2 Fix race conditions in breadcrumbs
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in #98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes #98338
2024-10-22 22:08:46 -03:00
Thaddeus Crews
6ec3dc1fb5
Merge pull request #97649 from ohboh/literally-unusable-on-mobile-without-this
Fix `emulate_mouse_from_touch` setting affecting editor
2024-10-21 16:39:26 -05:00
Thaddeus Crews
7dbea98c49
Merge pull request #97005 from Repiteo/core/window-corner-style
Core: Add `DisplayServer` flag for sharp corners
2024-10-21 16:39:25 -05:00
Thaddeus Crews
f8c4a683d7
Core: Add DisplayServer flag for sharp corners 2024-10-18 11:20:21 -05:00
Yevhen Babiichuk (DustDFG)
af6d260c17 Don't include core/io/image.h in core/os/os.h
`core/os/os.h` doesn't use `core/io/image.h`. It just brings
transitive dependencies. Lots of dependencies because `core/os/os.h`
is transitively included in almost every file of godot

Also added `core/io/image.h` into files^1 where `Ref<Image>` and `core/os/os.h`
were used to prevent obscure errors involving `Ref<Image>`

^1 except those which include `core/io/image_loader.h` or `core/io/image.h` by
corresponding .h file with the same name

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-10-18 19:04:19 +03:00
Haoyu Qiu
3dea83215c Fix some strings not caught by editor pseudolocalization 2024-10-17 09:36:02 +08:00
Rémi Verschelde
05b519fafb
Merge pull request #96230 from timothyqiu/per-domain-pseudolocalization
Move pseudolocalization into `TranslationDomain`
2024-10-04 11:21:18 +02:00
Dario
e2c6daf7ef Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR #87590.
- Adds ubershaders that can run with specialization constants specified as push constants.
- Pipelines with specialization constants can compile in the background.
- Added monitoring for pipeline compilations.
- Materials and shaders can now be created asynchronously on background threads.
- Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
2024-10-02 15:11:58 -03:00
Brandon Chang
e0957c2fa3
Consolidate remembering window settings into single config 2024-10-01 16:35:36 +02:00
obo
4ef07cb9a5 Fix "emulate mouse from touch" setting affecting editor
Make "emulate mouse from touch" always true in the editor
2024-10-01 02:23:32 +08:00
Rémi Verschelde
dbf1efbd19
Merge pull request #97442 from dustdfg/disable_xr/missing_disable_3d_ifndefs
Add missing `#ifndef _3D_DISABLED` to main file
2024-09-26 12:45:54 +02:00
Rémi Verschelde
2912cb9975
Merge pull request #97118 from mihe/patch-exports
Add ability to export patch packs
2024-09-26 12:45:42 +02:00
Mikael Hermansson
d3be030ea6 Add ability to export patch packs
Co-authored-by: Poq Xert <poqxert@poqxert.ru>
2024-09-25 17:07:28 +02:00
Thaddeus Crews
9f9ee0c813
SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Yevhen Babiichuk (DustDFG)
415607784f Add missing #ifndef _3D_DISABLED to main file
XR is disabled when 3D is disbled so there is no sense in
setting xr specific settings and adding `--xr-mode` option

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2024-09-25 14:24:59 +03:00
Ricardo Buring
7c4c4b9987 Move Godot Physics 2D into a module; add dummy 2D physics server
If the module is enabled (default), 2D physics works as it did before.

If the module is disabled and no other 2D physics server is registered
(via a module or GDExtension), then we fall back to a dummy
implementation which effectively disables 2D physics functionality (and
a warning is printed).

The dummy 2D physics server can also be selected explicitly, in which
case no warning is printed.
2024-09-23 17:33:45 +02:00
Ricardo Buring
0333648cea Move Godot Physics 3D into a module; add dummy 3D physics server
If the module is enabled (default), 3D physics works as it did before.

If the module is disabled and no other 3D physics server is registered
(via a module or GDExtension), then we fall back to a dummy
implementation which effectively disables 3D physics functionality (and
a warning is printed).

The dummy 3D physics server can also be selected explicitly, in which
case no warning is printed.
2024-09-21 21:19:45 +02:00
Haoyu Qiu
cca54ba4db Move pseudolocalization into TranslationDomain
Also adds command-line option `--editor-pseudolocalization`
2024-09-21 18:28:12 +08:00
SheepYhangCN
3b839347df Added fallback_to_opengl3 2024-09-20 06:10:05 +08:00
Pedro J. Estébanez
5d371e3378 WorkerThreadPool: Add safety point between languages finished and pool termination 2024-09-16 18:20:10 +02:00
Pedro J. Estébanez
e2fd88ed91 Revert "WorkerThreadPool: Enhance lifetime for more flexibility"
This reverts commit 2d1dd41ef5.
2024-09-13 14:39:11 +02:00
David Snopek
30a63396e5 Fix launching XR apps from the Android editor 2024-09-11 14:31:54 -05:00
Rémi Verschelde
658b8a8704
Merge pull request #96760 from RandomShaper/wtp_langs_exit_thread
Make use of languages' thread enter/exit more correct
2024-09-11 12:35:07 +02:00
Pedro J. Estébanez
2d1dd41ef5 WorkerThreadPool: Enhance lifetime for more flexibility 2024-09-10 11:08:51 +02:00
bruvzg
3009073b39 [Resource Loader] Do not check property type for non registered properties. 2024-09-10 11:27:16 +03:00
Fredia Huya-Kouadio
9dc0543da7 Improve support for XR projects 2024-09-06 00:35:50 -07:00
Rémi Verschelde
d8e2a2b860
Merge pull request #95005 from jsjtxietian/export-proj
Fix crash or unclear messages when exporting with invalid arguments
2024-09-05 17:44:07 +02:00