Commit Graph

280 Commits

Author SHA1 Message Date
David Snopek c767cc16ea [openxr] Remove unnecessary fallbacks for native handles on X11 2022-11-09 08:09:07 -06:00
David Snopek 23603e409c Add support for OpenGL to OpenXR 2022-11-08 18:47:11 -06:00
rsjtdrjgfuzkfg 4243b85990 OpenXR: support XR_KHR_android_create_instance
This commit adds support for the OpenXR extension
XR_KHR_android_create_instance, which seems to be required on Pico
devices.
2022-11-04 01:57:48 +01:00
Rémi Verschelde c98d6142d0
Merge pull request #68102 from BastiaanOlij/fix_render_issues_xr
Fix several render issues found while debugging XR
2022-11-03 22:37:42 +01:00
Rémi Verschelde f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Bastiaan Olij a4e58ec84a Fix several render issues found while debugging XR 2022-11-01 13:27:03 +11:00
Rémi Verschelde 5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde 420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Bastiaan Olij 91945c3077 Change default OpenXR pose to aim pose 2022-10-28 01:56:06 +11:00
Marc Gilleron 7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Max Hilbrunner 5f7906a289
Merge pull request #67527 from BastiaanOlij/fix_tracker_names
Fix two typos in tracker names and a bug in OpenXR haptic feedback
2022-10-19 18:18:36 +02:00
kobewi e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Bastiaan Olij 4a96fce801
Merge pull request #67529 from BastiaanOlij/filter_out_htc_paths
Filter out HTC OpenXR paths based on extension
2022-10-19 01:53:56 +11:00
Bastiaan Olij 19f9fe1dec Filter out HTC OpenXR paths based on extension 2022-10-19 00:09:54 +11:00
Bastiaan Olij 45ce45c001 Fix missing itos for OpenXR logging 2022-10-18 13:55:39 +11:00
Rémi Verschelde 667bc202b5 Merge pull request #67179 from BastiaanOlij/openxr_add_refresh_rate_extension
Adding support for the OpenXR Display Refresh Rate extension
2022-10-17 17:32:01 +02:00
Bastiaan Olij 1e7f009492 Fix two typos in tracker names and a bug in OpenXR haptic feedback 2022-10-17 20:29:19 +11:00
Bastiaan Olij e14717bb2e Adding support for the OpenXR Display Refresh Rate extension 2022-10-10 20:41:46 +11:00
Bastiaan Olij 7f6c00f41a Cleanup a bunch of debug messages in OpenXR and change the ones we want to keep to print_verbose 2022-10-10 20:19:18 +11:00
bruvzg 0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Bastiaan Olij c6ba626af4 Fixing an incorrect error message in OpenXR reporting missing OpenGL support 2022-10-06 11:15:57 +11:00
Rémi Verschelde 3a2b0ab73d Merge pull request #66898 from aaronfranke/proj-mat-columns
Rename Projection `matrix` to `columns`
2022-10-05 08:35:26 +02:00
Bastiaan Olij c7656978ba Adding getters to RenderTarget and implementing override functionality for XR 2022-10-05 11:37:49 +11:00
Aaron Franke 2cea42cc7f
Rename Projection `matrix` to `columns` 2022-10-04 12:34:19 -05:00
Rémi Verschelde f47979f087
Merge pull request #66242 from akien-mga/scons-unify-tools-target 2022-09-30 12:28:50 +02:00
Gabor Koncz 72203a4da4 Add Passthrough extension wrapper 2022-09-27 12:26:53 +02:00
Rémi Verschelde 809927862b Merge pull request #66282 from BastiaanOlij/openxr_palm_pose
Add OpenXR palm pose extension support
2022-09-27 10:03:56 +02:00
Rémi Verschelde 39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Bastiaan Olij 23d32c0e16 Adding OpenXR hand tracking support 2022-09-26 19:47:06 +10:00
Rémi Verschelde 3472bdd6b6 Merge pull request #65798 from kisg/dynamic_openxr_loader
Dynamic loading of OpenXR Loader on Android
2022-09-26 08:27:24 +02:00
Gergely Kis d5445c25a6 Dynamic loading of OpenXR Loader on Android
This change implements dynamic loading of the OpenXR Loader library
on Android. If an OpenXR Loader library is not found,
Godot will still function with OpenXR disabled.

Also, on every platform, the OpenXR symbols are resolved at runtime
using xrGetInstanceProcAddr.

On Windows and Linux the OpenXR loader is included in the main
engine binary.

On Android, the OpenXR Loader is not built with the engine. Separately
distributed Android plugins will be provided with the correct loader
library for each device.

Co-authored-by: Gábor Pál Korom <gabor.p.korom@migeran.com>
Co-authored-by: Gábor Koncz <gabor.koncz@migeran.com>
2022-09-24 13:57:03 +02:00
Bastiaan Olij 6da6e1690e Add OpenXR palm pose extension support 2022-09-23 13:20:12 +10:00
Gabor Koncz 8972600146 Fix OpenXR layer composition blending 2022-09-16 12:52:01 +02:00
Yuri Sizov 43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
Rémi Verschelde fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
Rémi Verschelde f7f8af232c
Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky ef5b9a06a9 Rename `hint_tooltip` to `tooltip_text` & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
Yuri Sizov d953d9590b Improve the `make_rst.py` parser for BBCode tags 2022-08-15 17:45:10 +03:00
Raul Santos 232f1161f5
Expose string array properties in OpenXR module as PackedStringArray 2022-08-11 00:59:47 +02:00
Yuri Sizov c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
kobewi c3606cb5f3 Swap arguments of ResourceSaver.save() 2022-07-29 19:53:09 +02:00
Juan Linietsky d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Bastiaan Olij 1dd671014b Add startup flag to override XR mode settings 2022-07-28 11:50:34 +10:00
RedMser 7b834c8bfd Fix unnamed arguments in XML docs 2022-07-26 20:42:38 +02:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
reduz 455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
python273 f78d06c9fe Fix tutorial links in XR classes docs 2022-07-22 15:05:31 +03:00
Riteo a21f8b7c13 Improve `linuxbsd` headless building, cleanup build scripts
Now the `linuxbsd` platform can be built headlessly (e.g. without X11
development libraries).

I also cleaned up some weird (old?) usages of the `env` variable which
seem to make no difference and are used nowhere else.
2022-07-20 19:48:35 +02:00
Bastiaan Olij ecfcfd97fa Split dependency logic
Split FOG
Split visibility notifier
Final cleanup of storage classes
2022-06-28 00:10:29 +10:00
Bastiaan Olij 95f75b232f Adding HTC tracker support 2022-06-16 16:52:13 +10:00
K. S. Ernest (iFire) Lee 10131eb6f2 Expose XRPose's get angular velocity. 2022-06-14 07:33:22 -07:00
FireForge eb573da2b5 Use "odd" style for TabContainers on base BG color
- Use the "odd" style for TabContainers that are on a background with the same color as the default TabContainer background color to add contrast
2022-05-26 21:19:15 -05:00
Nathan Franke 77c8f271e7
use ERR_FAIL_INDEX when preferred 2022-05-25 13:36:45 -05:00
Saenoe 95ef3bafcd fix OpenXRAPI::is_extension_supported returning opposite result 2022-05-18 00:33:22 +02:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Rémi Verschelde 9c746b3213
Merge pull request #60949 from derammo/derammo_openxr_wrong_conditional 2022-05-11 20:05:54 +02:00
derammo 0571148a4b corrected conditional compile of OpenXR with/without opengl3 driver 2022-05-11 11:25:55 -04:00
Bastiaan Olij 9939cfc4c4 Split out bokeh_dof and copy effects 2022-05-11 11:08:56 +10:00
reduz de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
Markus Sauermann a793960a10 Fix cppcheck const parameters
Convert method signature parameters to const where it is possible

# Conflicts:
#	drivers/gles3/rasterizer_canvas_gles3.cpp
#	drivers/gles3/rasterizer_canvas_gles3.h
#	editor/plugins/animation_state_machine_editor.cpp
#	editor/plugins/animation_state_machine_editor.h
2022-04-28 11:35:39 +02:00
Haoyu Qiu 925e8c8f3e Validate input in OpenXR array setter 2022-04-20 11:00:58 +08:00
Bastiaan Olij 6b28d94e77 Merge canvas and decal into TextureStorage and add render target 2022-04-17 12:59:50 +10:00
Josh Kabo 1570bcd03b catch null profile_def causing crash on startup 2022-04-11 08:55:23 -07:00
Rémi Verschelde 831dc74b1f
Merge pull request #59940 from BastiaanOlij/xr_new_controllers_20220405 2022-04-11 11:38:39 +02:00
Bastiaan Olij f8dab282cb Added missing interaction profiles and making sure related extensions are enabled if available 2022-04-06 23:00:26 +10:00
Rémi Verschelde 77843355a0 CI: Update black formatter and apply changes 2022-04-05 17:43:12 +02:00
Rémi Verschelde b78aa4fe19 Style: Apply clang-tidy to current code, add `readability-redundant-member-init` 2022-04-04 21:49:51 +02:00
Rémi Verschelde f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Bastiaan Olij 9b7b9de0e5 Add action map editor for OpenXR 2022-04-04 18:43:29 +10:00
Rémi Verschelde a647fb3e62 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-03-31 14:07:29 +02:00
bruvzg d2add64f91
Move OpenXR project settings to the main, to make them visible on unsupported platforms. 2022-03-29 23:25:33 +03:00
Bastiaan Olij c78876f977 Cleanup OpenXR on initialisation failure 2022-03-25 18:30:47 +11:00
Bastiaan Olij d2ef2715ea Only uninitialise OpenXR on destruct if it was initialised 2022-03-11 09:59:04 +11:00
Bastiaan Olij d11cb5fe98 Adding signals and events to OpenXR interface
Improving interaction profile logic
2022-03-10 17:14:56 +11:00
Bastiaan Olij 8f035b2ab4 Fix color issues with OpenXR 2022-02-28 13:02:03 +11:00
Bastiaan Olij 1f1b786a36 Use VK_NULL_HANDLE when initializing XrSwapchainImageVulkanKHR 2022-02-27 21:13:02 +11:00
Gilles Roudière f045c97218 Fix llvm compilation by adding missing override 2022-02-23 18:07:02 +01:00
Bastiaan Olij a78a9fee71 Implementing OpenXR driver 2022-02-23 12:02:24 +01:00