Commit Graph

1402 Commits

Author SHA1 Message Date
Ivan Shakhov 77b9e60303 [DAP] Add --dap-port as a command line argument, very similar to --lsp-port 2024-05-30 21:46:37 +02:00
bruvzg 2c9df769ad
Clean Input::frame_parsed_events before de-initialising scripting languages to ensure no script created events exist at the exit. 2024-05-30 13:23:00 +03:00
patwork 2dedf6253b Fix -empty string- console log in web export 2024-05-28 12:32:46 +02:00
Paulo Poiati a3769c0edc Properly set window class in Wayland 2024-05-22 10:42:12 -03:00
Rémi Verschelde f58a96cfa2
Merge pull request #92075 from autoit4you/fix-92062
Use `GLOBAL_GET` for `window_{height,width}_override`
2024-05-18 17:41:48 +02:00
Lea 414cc6c89e Use GLOBAL_GET for window_{height,width}_override
Before ProjectSettings::get was used, resulting in ignoring
feature tag overrides for display/window/size/window_width_override
and display/window/size/window_height_override.

Fixes #92062
2024-05-18 11:51:04 +02:00
Raul Santos e516479889
Release Engine after unregistering GDExtensions
The Engine is used to retrieve singletons, and GDExtensions may try to retrieve a singleton (e.g.: `OS`) in their deinitialization.
2024-05-17 21:29:11 +02:00
Rémi Verschelde 2f1aaca167
Merge pull request #91927 from timothyqiu/monitor-names
Make performance monitor names translatable
2024-05-14 12:07:14 +02:00
Haoyu Qiu d33e79f299 Make performance monitor names translatable 2024-05-14 10:05:32 +08:00
kobewi 413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
Programneer efaba30116 Don't define NO_EDITOR_SPLASH in export templates 2024-05-12 13:12:56 +02:00
A Thousand Ships a0dbdcc3ab
Replace `find` with `contains/has` where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
David Snopek 2c5c3ae579 Generate docs from GDExtensions using `--gdextension-docs` with `--doctool` 2024-05-07 11:45:17 -05:00
A Thousand Ships 955d5affa8
Reduce and prevent unnecessary random-access to `List`
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
Bastiaan Olij 527c30c594 Add support for OpenXR hand interaction extension 2024-05-02 19:15:02 +10:00
RedMser 3047bd4339 Ensure --doctool is run from root directory when implicit cwd is used 2024-05-01 13:36:37 +02:00
kobewi 3ebb5b84a0 Add separate feature tags for editor runtime 2024-04-26 14:44:38 +02:00
Kusok 1e8eff815a Don't ignore `audio/driver/output_latency.web` 2024-04-25 17:09:45 +08:00
kobewi 12f39befa9 Use minor version in EditorSettings file name 2024-04-19 00:13:06 +02:00
Rémi Verschelde 35369b8d28
Merge pull request #90507 from Calinou/tests-disabled-error-on-test-cli-argument
Exit with an error if using `--test` on binary without unit tests compiled
2024-04-18 12:24:24 +02:00
A Thousand Ships abe7ec1543
Fix some build errors with `disable_3d=yes` 2024-04-16 14:25:36 +02:00
Rémi Verschelde c951421c99
Merge pull request #90268 from RandomShaper/wtp_servers
Use WorkerThreadPool for Server threads (enhanced)
2024-04-15 10:12:00 +02:00
Aaron Franke 6dd4a68797
Reorganize some code to have 2D things grouped together 2024-04-13 02:56:50 -07:00
Hugo Locurcio 7467ce6405
Exit with an error if using `--test` on binary without unit tests compiled
This makes it clearer that `tests=yes` should be used at compile-time.
Previously, the engine would run as if the argument wasn't passed,
which can be confusing.
2024-04-11 00:07:42 +02:00
Juan Linietsky 65686dedf9 Use WorkerThreadPool for Server threads
* Servers now use WorkerThreadPool for background computation.
* This helps keep the number of threads used fixed at all times.
* It also ensures everything works on HTML5 with threads.
* And makes it easier to support disabling threads for also HTML5.

CommandQueueMT now syncs with the servers via the WorkerThreadPool
yielding mechanism, which makes its classic main sync semaphore
superfluous.

Also, some warnings about calls that kill performance when using
threaded rendering are removed because there's a mechanism that
warns about that in a more general fashion.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2024-04-10 18:47:42 +02:00
Mikael Hermansson 9d01793dff Add `--import` command-line flag 2024-04-09 15:18:59 +02:00
smix8 a67037635b Remove NavigationServerDummy warnings
Removes NavigationServerDummy warnings.
2024-04-06 03:07:22 +02:00
Samuel Nicholas 93559db3a2
Properly skip printing version header with `--no-header`
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-03-26 11:41:13 +01:00
Rémi Verschelde f49efbe0e5
Merge pull request #89229 from akien-mga/main-refactor-os-exit-code
Refactor OS exit code to be `EXIT_SUCCESS` by default
2024-03-24 01:15:06 +01:00
Ricardo Buring 2ed2ccc2d8 Fixed Timestep Interpolation (2D)
Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-03-23 12:28:36 +01:00
Rémi Verschelde 453485aede
Merge pull request #89270 from Repiteo/enforce-typename-in-templates
Enforce template syntax `typename` over `class`
2024-03-14 22:34:37 +01:00
Aaron Franke 9e0b38ecd3 Disable XR server when compiling without 3D 2024-03-13 09:02:10 -07:00
Thaddeus Crews 5a6e3cbcb0
SCons: Remove `run_in_subprocess` dependency 2024-03-11 13:20:09 -05:00
Rémi Verschelde f040a351c2
Merge pull request #89381 from aaronfranke/disable-3d
Disable all 3D nodes, physics, and resources when compiling without 3D
2024-03-11 14:02:57 +01:00
Rémi Verschelde 0475011c66
Merge pull request #82084 from ogapo/pr/pck-cache-merge
Merge `uid_cache.bin` and `global_script_class_cache.cfg` after mounting PCKs
2024-03-11 14:01:16 +01:00
Aaron Franke 6aac3e4a16 Disable all 3D nodes, physics, and resources when compiling without 3D 2024-03-11 01:00:55 -07:00
Thaddeus Crews d9fa40f2df
Enforce `\n` eol for Python writes
• Ensure utf-8 encoding if previously unspecified
2024-03-09 14:29:24 -06:00
Rémi Verschelde 023dcd44c1
Refactor OS exit code to be `EXIT_SUCCESS` by default
- `Main::setup` early exits (failure or `--help`/`--version`) now
  consistently return `EXIT_FAILURE` or `EXIT_SUCCESS` on all platforms,
  instead of 255 on some and a Godot Error code on others.
- `Main::start` now returns the exit code, simplifying the handling of early
  failures.
- `Main::iteration` needs to explicit set the exit code in OS if it errors
  out.
- Web and iOS now properly return `OS::get_exit_code()` instead of 0.
2024-03-08 23:31:24 +01:00
Thaddeus Crews 9903e6779b
Enforce template syntax `typename` over `class` 2024-03-07 22:39:09 -06:00
David Nikdel 5e6adb4a2d Merge uid_cache.bin and global_script_class_cache.cfg after mounting PCKs
fixes godotengine#82061
fixes godotengine#61556

Also, distinguish between main pack and DLC packs.
It's desirable to downloaded content to be as small as possible. This change avoids bloating non-main pack files with new versions of resources that are all read on startup and never used again. They have no effect if loaded after startup.
- project.godot/project.binary file
- extension_list.cfg
- app icon and boot_splash
- .ico and .icns files (these can still be opted in for DLC by listing them explicitly in the include filter)
2024-03-06 12:14:21 -05:00
Rémi Verschelde e63de52bdb
Check if DisplayServer supports icons before attempting setting it 2024-03-05 14:39:11 +01:00
Thaddeus Crews 0ce9b6fd1d
Add two new COMSTR environment variables 2024-03-01 12:44:03 -06:00
Rémi Verschelde 3a08c646ee
Pre-commit: Update to clang-format 17.0.6 and black 24.2.0 2024-02-28 14:25:35 +01:00
Hugo Locurcio 67e9ccdbc4
Display the build date in the editor and when starting the engine
This can be used to quickly see how recent a development build is,
without having to look up the commit date manually.
When juggling around with various builds (e.g. for benchmarking),
this can also be used to ensure that you're actually running the
binary you intended to run.

The date stored is the date of the Git commit that is built, not
the current date at the time of building the binary. This ensures
binaries can remain reproducible.

The version timestamp can be accessed using the `timestamp` key
of the `Engine.get_version_info()` return value.
2024-02-27 20:39:17 +01:00
A Thousand Ships f06222e487
[Physics] Fix export with 3D disabled 2024-02-22 16:23:48 +01:00
Anatoli Babenia e25cfffc7f Add `--no-header` option to clean output
* Do not print empty line when header is disabled
* Do not print Vulcan header
* Also add "Print header" project setting (default On)
  (suggested by @kaissouDev)
* Add docs for the project setting
  (with suggestions by @Mickeon and @akien-mga)

Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-02-15 14:10:11 +03:00
Hugo Locurcio 67b8d71c79 Disable ReShade in the editor and project manager (if run via Vulkan)
ReShade can still be used on projects run from the editor as well
as exported projects.

This avoids several issues:

- ReShade doesn't play well with low-processor mode, making it hard
  to use unless the Update Continuously editor setting is enabled.
- The ReShade overlay appears on every popup opened, which made popups
  unusable.
- If you use a ReShade configuration that heavily affects the image,
  it won't affect the editor UI which may become unreadable as a result.

This doesn't affect the editor being run via OpenGL or Direct3D 12
as ReShade is injected in a different manner when using those graphics
APIs.
2024-02-14 06:30:20 +01:00
Rémi Verschelde afc49e52e4
Merge pull request #88130 from AlekseyKapustyanenko/Rotary_Input
Add rotary input support for Android platform
2024-02-13 23:43:33 +01:00
ALEKSEY KAPUSTYANENKO d5c2a641f0 Add rotary input support. Fix documentation 2024-02-13 21:12:59 +04:00
Rémi Verschelde c8b5290119
Merge pull request #87013 from bruvzg/intel_angle_with_ids
[Windows] Add support for hex vendor/device IDs in the Angle blocklist. Add Intel Gen5/Gen6/Gen7 GPUs to Angle blocklist.
2024-02-13 17:23:41 +01:00
Rémi Verschelde 62143552f3
Merge pull request #87635 from rune-scape/manage-time-singleton
Manage time singleton in `register_core_types`
2024-02-12 13:34:13 +01:00
rune-scape c5bcc3ae86 Manage time singleton 2024-02-11 14:39:20 -08:00
A Thousand Ships 684752e75b
Replace error checks against `size` with `is_empty` 2024-02-09 12:50:15 +01:00
Riteo 2677af7794 Handle display driver preferences consistently between editor and projects
The way that it was implemented before allowed for the project property
to spill over to the editor if the `prefer_wayland` property is not
present which, while not completely likely, is still a possibility. This
specific part is thus more of a correctness change, ensuring that we
always enforce the default display server when not running a project.

This commit also removes the restart requirement for the relative
display driver project settings as they're independent and a restart
would do nothing useful.
2024-02-07 16:49:21 +01:00
Hugo Locurcio f7f51bdd7a
Add colors to the command-line help 2024-02-01 23:44:29 +01:00
Riteo 7e0f7d3abd Add Wayland support
Not everything is yet implemented, either for Godot or personal
limitations (I don't have all hardware in the world). A brief list of
the most important issues follows:

- Single-window only: the `DisplayServer` API doesn't expose enough
information for properly creating XDG shell windows.

- Very dumb rendering loop: this is very complicated, just know that
the low consumption mode is forced to 2000 Hz and some clever hacks are
in place to overcome a specific Wayland limitation. This will be
improved to the extent possible both downstream and upstream.

- Features to implement yet: IME, touch input, native file dialog,
drawing tablet (commented out due to a refactor), screen recording.

- Mouse passthrough can't be implement through a poly API, we need a
rect-based one.

- The cursor doesn't yet support fractional scaling.

- Auto scale is rounded up when using fractional scaling as we don't
have a per-window scale query API (basically we need
`DisplayServer::window_get_scale`).

- Building with `x11=no wayland=yes opengl=yes openxr=yes` fails.

This also adds a new project property and editor setting for selecting the
default DisplayServer to start, to allow this backend to start first in
exported projects (X11 is still the default for now). The editor setting
always overrides the project setting.

Special thanks to Drew Devault, toger5, Sebastian Krzyszkowiak, Leandro
Benedet Garcia, Subhransu, Yury Zhuravlev and Mara Huldra.
2024-01-30 16:44:47 +01:00
David Snopek a8690cbeed Add support for OpenXR local floor extension 2024-01-23 09:19:09 -06:00
Hugo Locurcio 6e5e7b8cb7
Add `--log-file` command line argument to write output log to a file
This works even if file logging is disabled in the project settings,
or for the editor/project manager.

`--log-file`'s value can be an absolute path or relative to the project
directory (similar to existing arguments like `--write-movie`).
2024-01-19 20:30:04 +01:00
Rémi Verschelde fa81059b9d
Merge pull request #85939 from adamscott/single-threaded-godot-4
Add `THREADS_ENABLED` macro in order to compile Godot to run on the main thread
2024-01-18 09:33:52 +01:00
Adam Scott bd70b8e1f6
Add THREADS_ENABLED macro in order to compile Godot to run on the main thread 2024-01-17 13:58:29 -05:00
Rémi Verschelde 0a7579b161
Fix `#if *_ENABLED` inconsistencies, should check if defined
Co-authored-by: Caroline Joy Bell <halotroop2288@proton.me>
2024-01-17 10:30:15 +01:00
Rémi Verschelde dc79e956b6
Merge pull request #86587 from RandomShaper/wtp_enhance
Enhance & fix `WorkerThreadPool`
2024-01-11 17:38:09 +01:00
bruvzg 3badb90020 [Windows] Add support for hex vendor/device IDs in the Angle blocklist. Add Intel Gen5/Gen6/Gen7 GPUs to Angle blocklist. 2024-01-09 19:28:45 +02:00
kobewi 0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
Pedro J. Estébanez 9444d297ed WorkerThreadPool: Overhaul scheduling and synchronization
This commits rewrites the sync logic in a way that the
`use_system_threads_for_low_priority_tasks` setting, which was added due to
the lack of a cross-platform wait-for-multiple-objects functionality, can be
removed (it's as if it was effectively hardcoded to `false`).

With the new implementation, we have the best of both worlds: threads don't
have to poll, plus no bespoke threads are used.

In addition, regarding deadlock prevention, since not every possible case of
wait-deadlock could be avoided, this commits removes the current best-effort
avoidance mechanisms and keeps only a simple, pessimistic way of detection.

It turns out that the only current user of deadlock prevention, ResourceLoader,
works fine with it and so every possible situation in resource loading is now
properly handled, with no possibilities of deadlocking. There's a comment in
the code with further details.

Lastly, a potential for load tasks never being awaited/disposed is cleared.
2024-01-08 12:45:42 +01:00
Hugo Locurcio 6da4d5bd60
Suggest `--headless` CLI argument in DisplayServer not found error message
This is helpful for newcomers setting up Godot on CI, as this provides
automatic guidance as for why it doesn't run out of the box if
there's no X11 server available.
2023-12-21 23:42:39 +01:00
Yuri Sizov 3a8524dd92
Merge pull request #83452 from RandomShaper/rd_common
Split `RenderingDevice` into API-agnostic and `RenderingDeviceDriver` parts
2023-12-20 20:09:18 +01:00
Pedro J. Estébanez 12a519bae2 Split RenderingDevice into API-agnostic and RenderingDeviceDriver parts
Credit and thanks to @bruzvg for multiple build fixes, update of 3rd-party items and MinGW support.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-12-20 19:18:08 +01:00
bruvzg e01b22a69d
[Windows] Make Windows Ink tablet API default, add dummy driver to disable tablet input. 2023-12-18 22:36:54 +02:00
Rémi Verschelde 41365c6c8b
Merge pull request #70315 from RandomShaper/d3d12_mesa
Direct3D 12 Rendering Driver (Mesa NIR approach)
2023-12-12 21:58:57 +01:00
Pedro J. Estébanez 2f47c57385 Add Direct3D 12 RenderingDevice implementation 2023-12-12 19:10:04 +01:00
Rémi Verschelde 748113280f
Merge pull request #85273 from bruvzg/amd_ban
Force ANGLE on all pre GCN 4th gen. AMD/ATI GPUs.
2023-12-12 10:39:52 +01:00
Yuri Sizov 07677f0f51 Merge pull request #85885 from YuriSizov/bench-pressing
Improve engine startup/shutdown benchmarks
2023-12-08 17:12:26 +01:00
Yuri Sizov 9dce1a45a0 Merge pull request #85819 from Malcolmnixon/export-android-build-template
Add option to install android build template for export
2023-12-08 16:58:54 +01:00
Malcolm Nixon 988c1bf298 Add option to install android build template for export
This PR adds a new "--install-android-build-template" command-line option which causes the android build template to be installed before exporting the project.
2023-12-08 09:00:25 -05:00
Yuri Sizov d7cca8162d Improve logging and benchmarking in Main 2023-12-08 12:53:04 +01:00
Yuri Sizov fc3f40f37d Improve engine startup/shutdown benchmarks
- Add contexts to give a better sense of benchmarked areas.
- Add missing benchmarks and adjust some begin/end points.
- Clean up names.
- Improve Android's internal benchmarks in a similar manner.

Co-authored-by: Fredia Huya-Kouadio <fhuya@meta.com>
2023-12-08 12:53:04 +01:00
Rémi Verschelde cff4af018f
CI: Add 4.2-stable.expected file for GDExtension compatibility checks 2023-12-07 09:36:54 +01:00
bruvzg d48524a3f4
[macOS] Switch ANGLE backend to ANGLE over OpenGL, switch default compatibility renderer back to native. 2023-12-05 15:39:40 +02:00
bruvzg 54747fab72
Force ANGLE on all pre GCN 4th gen. AMD/ATI GPUs. 2023-11-23 19:15:25 +02:00
Yuri Sizov bc1949d797 Correctly check scripts that must inherit `EditorPlugin`
Also updates some error messages related to this kind of check
across the codebase.
2023-11-23 16:24:43 +01:00
bruvzg cf56b881eb
[macOS] Cleanup default GL driver setting. 2023-11-15 10:07:16 +02:00
Hugo Locurcio a63556212d
Don't apply frame delay project setting to the editor
This appears to already be the case for the Max FPS project setting.
2023-11-12 12:09:39 +01:00
bruvzg 173b84127b
[Windows] Add some AMD GPUs to the OpenGL blocklist. 2023-11-09 20:11:04 +02:00
bruvzg f3d4f5a77e
[X11] Add fallback from desktop GL to GLES, suppress PRIME detector error spam. 2023-11-06 12:40:44 +02:00
Yuri Sizov b733901e9e Merge pull request #84354 from RandomShaper/gdext_no_cache_doc
Polish & fix editor help cache generation
2023-11-02 20:34:22 +01:00
Pedro J. Estébanez a1d8fc1af9 Polish & fix editor help cache generation
- Isolated the generation of extensions's docs. They're now not cached and refreshed as needed.
- Removed superfluous sorting of the class list.
- Removed some superfluous/unused elements.
- Renamed some items for clarity.
2023-11-02 13:46:37 +01:00
Rémi Verschelde 799d30c306
Merge pull request #83753 from bruvzg/mac_angle_fb
[macOS] Fallback to native OpenGL renderer if ANGLE initialization failed.
2023-10-31 20:14:42 +01:00
bruvzg f8829c80bb
Fix missing initial position modes for the main window. 2023-10-23 09:56:59 +03:00
bruvzg 590c353707
[macOS] Fallback to native OpenGL renderer if ANGLE initialization failed. Remove platform specific renderer config values from docs. 2023-10-21 22:09:35 +03:00
Daylily-Zeleen fee3b85a2b Fix missing editor singletons when dump extension api 2023-10-13 14:36:51 +08:00
Rémi Verschelde 4b7cc99bc1
Merge pull request #79169 from reduz/debug-canvas-item-redraw
Debug CanvasItem redraw
2023-10-11 08:40:05 +02:00
Rémi Verschelde 1fe7f8a96c
Merge pull request #82893 from m4gr3d/godot_android_lib_improvements
Cleanups and improvements to the Godot Android library api
2023-10-10 09:11:53 +02:00
Fredia Huya-Kouadio 2951c162ed Cleanups and improvements to the Godot Android library api:
- Provide api to retrieve the running Godot instance from a GodotHost
- Provide api for the GodotHost to register runtime GodotPlugin instances
- Hide the GodotService class until it's completed
- Include project setting to enable long press for Android devices
- Include project setting to enable pan and scale gestures on Android devices
2023-10-08 05:30:38 -07:00
Jack Wilsdon 22b00e392e Fix building without GDScript
Fixes #82231
2023-10-08 01:29:04 +01:00
Rémi Verschelde d7bca20359
Merge pull request #82722 from BastiaanOlij/openxr_fix_hand_tracking_issues
OpenXR: Fix small hand tracking issues
2023-10-04 15:43:18 +02:00
bruvzg af00c4a54a
[X11] Add support for using EGL/GLES instead of GLX. 2023-10-04 14:15:36 +03:00
Bastiaan Olij c60ef33175 OpenXR Fix small hand tracking issues 2023-10-04 13:18:31 +11:00
Rémi Verschelde 3a5d524287
Merge pull request #82614 from m4gr3d/openxr_eye_gaze_interaction
Add support for the OpenXR Eye gaze interaction extension
2023-10-03 17:25:52 +02:00
bruvzg ac3fc2a8a1
[ANGLE] Add fallback control options and defaults.
[macOS] Use ANGLE by default if engine is built with statically linked ANGLE.
[Windows] Add option enable/disable fallback to ANGLE and option force specific GPU to always use ANGLE.
2023-10-03 16:23:43 +03:00