diff --git a/build.gradle b/build.gradle index cfdb5663..06e64d97 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ task "generatePngs"() { android { namespace "org.meumeu.wivrn" - ndkVersion "27.1.12297006" + ndkVersion "28.1.13356709" lint { disable += "ExpiredTargetSdkVersion" diff --git a/client/application.cpp b/client/application.cpp index f8ec53a8..5bf205af 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -1113,6 +1113,7 @@ void application::initialize() opt_extensions.push_back(XR_KHR_COMPOSITION_LAYER_DEPTH_EXTENSION_NAME); opt_extensions.push_back(XR_FB_COMPOSITION_LAYER_DEPTH_TEST_EXTENSION_NAME); opt_extensions.push_back(XR_KHR_COMPOSITION_LAYER_COLOR_SCALE_BIAS_EXTENSION_NAME); + opt_extensions.push_back(XR_EXT_USER_PRESENCE_EXTENSION_NAME); opt_extensions.push_back(XR_KHR_VISIBILITY_MASK_EXTENSION_NAME); opt_extensions.push_back(XR_FB_COMPOSITION_LAYER_SETTINGS_EXTENSION_NAME); diff --git a/client/render/scene_renderer.cpp b/client/render/scene_renderer.cpp index e2d8dc34..79b9187d 100644 --- a/client/render/scene_renderer.cpp +++ b/client/render/scene_renderer.cpp @@ -717,7 +717,7 @@ scene_renderer::per_frame_resources & scene_renderer::current_frame() void scene_renderer::update_material_descriptor_set(scene_data::material & material) { - if (!material.ds || !material.ds.unique()) + if (!material.ds || material.ds.use_count() != 1) material.ds = ds_pool_material.allocate(); vk::DescriptorSet ds = **material.ds; diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index e89605e5..f4c85870 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -21,6 +21,7 @@ #include "xr/fb_face_tracker2.h" #include "xr/htc_body_tracker.h" #include "xr/pico_body_tracker.h" +#include #define GLM_FORCE_RADIANS #include "stream.h" @@ -217,6 +218,7 @@ std::shared_ptr scenes::stream::create(std::unique_ptrinstance.has_extension(XR_EXT_USER_PRESENCE_EXTENSION_NAME) && self->system.user_presence_properties().supportsUserPresence; if (config.check_feature(feature::face_tracking)) { @@ -1287,6 +1289,11 @@ void scenes::stream::on_xr_event(const xr::event & event) .view_index = uint8_t(event.visibility_mask_changed.viewIndex), }); break; + case XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT: + network_session->send_control(from_headset::user_presence_changed{ + .present = (bool)event.user_presence_changed.isUserPresent, + }); + break; case XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED: on_interaction_profile_changed(event.interaction_profile_changed); break; diff --git a/client/xr/instance.h b/client/xr/instance.h index 16b5a654..e4c28f5f 100644 --- a/client/xr/instance.h +++ b/client/xr/instance.h @@ -43,6 +43,7 @@ union event XrEventDataDisplayRefreshRateChangedFB refresh_rate_changed; XrEventDataPassthroughStateChangedFB passthrough_state_changed; XrEventDataVisibilityMaskChangedKHR visibility_mask_changed; + XrEventDataUserPresenceChangedEXT user_presence_changed; }; class instance : public utils::handle { diff --git a/client/xr/system.cpp b/client/xr/system.cpp index 0c88054d..50c5acfc 100644 --- a/client/xr/system.cpp +++ b/client/xr/system.cpp @@ -105,6 +105,24 @@ XrSystemEyeGazeInteractionPropertiesEXT xr::system::eye_gaze_interaction_propert return eye_gaze_prop; } +XrSystemUserPresencePropertiesEXT xr::system::user_presence_properties() const +{ + if (!id) + throw std::invalid_argument("this"); + + XrSystemUserPresencePropertiesEXT presence_prop{ + .type = XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT, + }; + + XrSystemProperties prop{ + .type = XR_TYPE_SYSTEM_PROPERTIES, + .next = &presence_prop, + }; + CHECK_XR(xrGetSystemProperties(*inst, id, &prop)); + + return presence_prop; +} + XrSystemFaceTrackingProperties2FB xr::system::fb_face_tracking2_properties() const { if (!id) diff --git a/client/xr/system.h b/client/xr/system.h index 45e7729b..9905dca8 100644 --- a/client/xr/system.h +++ b/client/xr/system.h @@ -62,6 +62,7 @@ public: XrSystemProperties properties() const; XrSystemHandTrackingPropertiesEXT hand_tracking_properties() const; XrSystemEyeGazeInteractionPropertiesEXT eye_gaze_interaction_properties() const; + XrSystemUserPresencePropertiesEXT user_presence_properties() const; XrSystemFaceTrackingProperties2FB fb_face_tracking2_properties() const; XrSystemFacialTrackingPropertiesHTC htc_face_tracking_properties() const; XrSystemBodyTrackingPropertiesFB fb_body_tracking_properties() const; diff --git a/common/wivrn_packets.h b/common/wivrn_packets.h index 52b9bb0d..ac829131 100644 --- a/common/wivrn_packets.h +++ b/common/wivrn_packets.h @@ -216,6 +216,7 @@ struct headset_info_packet std::array fov; bool hand_tracking; bool eye_gaze; + bool presence; bool palm_pose; bool passthrough; face_type face_tracking; @@ -409,6 +410,11 @@ struct refresh_rate_changed float to; }; +struct user_presence_changed +{ + bool present; +}; + using packets = std::variant< crypto_handshake, pin_check_1, @@ -426,7 +432,8 @@ using packets = std::variant< timesync_response, battery, visibility_mask_changed, - refresh_rate_changed>; + refresh_rate_changed, + user_presence_changed>; } // namespace from_headset namespace to_headset diff --git a/dashboard/qml/ApkInstallPage.qml b/dashboard/qml/ApkInstallPage.qml index 60a65656..5ef5bc05 100644 --- a/dashboard/qml/ApkInstallPage.qml +++ b/dashboard/qml/ApkInstallPage.qml @@ -44,7 +44,7 @@ Kirigami.ScrollablePage { else if (!Adb.adbInstalled) return i18n("ADB is not installed."); else - return i18n("Connect a headset and make sure developper mode is enabled."); + return i18n("Connect a headset and make sure developer mode is enabled."); } explanation: { if (!ApkInstaller.busy && !ApkInstaller.apkAvailable) diff --git a/dashboard/qml/WizardPage.qml b/dashboard/qml/WizardPage.qml index 8933a386..76a31289 100644 --- a/dashboard/qml/WizardPage.qml +++ b/dashboard/qml/WizardPage.qml @@ -109,7 +109,7 @@ Kirigami.ScrollablePage { } Kirigami.Dialog { id: devmode_dialog - title: i18n("How to enable developper mode") + title: i18n("How to enable developer mode") showCloseButton: false padding: 2 * Kirigami.Units.largeSpacing ColumnLayout { @@ -216,7 +216,7 @@ Kirigami.ScrollablePage { Controls.Label { Layout.fillWidth: true wrapMode: Text.WordWrap - text: i18n("

No headset detected. Make sure that:\n

") + text: i18n("

No headset detected. Make sure that:\n

") onLinkActivated: devmode_dialog.open() MouseArea { anchors.fill: parent diff --git a/flake.nix b/flake.nix index 39a4b4eb..82580246 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ # Keep in sync with CMakeLists.txt monado rev rev = builtins.readFile ./monado-rev; # Nix will output the correct hash when it doesn't match - hash = "sha256-+PiWxnvMXaSFc+67r17GBRXo7kbjikSElawNMJCydrk="; + hash = "sha256-BiqNLYTQseymHgkZ3RLHOesxi6qaf4L0j8dgpgaG7LI="; }; }; diff --git a/locale/es/wivrn-dashboard.po b/locale/es/wivrn-dashboard.po index 8fdc632c..74d30780 100644 --- a/locale/es/wivrn-dashboard.po +++ b/locale/es/wivrn-dashboard.po @@ -93,7 +93,7 @@ msgstr "ADB no está instalado." #: dashboard/qml/ApkInstallPage.qml:47 #, kde-format -msgid "Connect a headset and make sure developper mode is enabled." +msgid "Connect a headset and make sure developer mode is enabled." msgstr "" "Conecta un visor y asegúrate de que el modo desarrollador esté activado." @@ -760,7 +760,7 @@ msgstr "Siguiente" #: dashboard/qml/WizardPage.qml:112 #, kde-format -msgid "How to enable developper mode" +msgid "How to enable developer mode" msgstr "Cómo habilitar el modo desarrollador" #: dashboard/qml/WizardPage.qml:119 @@ -831,7 +831,7 @@ msgstr "ADB no está instalado" msgid "" "

No headset detected. Make sure that:\n" "

" +"href=\"#\">developer mode

" msgstr "" "

No se detectó el visor. Asegúrate de que:\n" "

" msgstr "" "

Aucun casque détecté. Assurez-vous que:\n" "

" msgstr "" "

HMDは見つかりません。以下を確認しましょう:\n" "

" msgstr "" "

Nenhum headset detectado. Tenha certeza que:\n" "

  • As regras udev de ADB estejam instaladas
  • O headset esteja em " diff --git a/locale/zh_TW/wivrn-dashboard.po b/locale/zh_TW/wivrn-dashboard.po index cdabe4b6..320cb4e1 100644 --- a/locale/zh_TW/wivrn-dashboard.po +++ b/locale/zh_TW/wivrn-dashboard.po @@ -91,7 +91,7 @@ msgstr "未安裝 ADB" #: dashboard/qml/ApkInstallPage.qml:47 #, kde-format -msgid "Connect a headset and make sure developper mode is enabled." +msgid "Connect a headset and make sure developer mode is enabled." msgstr "連接頭戴式裝置並確認已啟用開發人員模式" #: dashboard/qml/ApkInstallPage.qml:51 dashboard/qml/WizardPage.qml:204 @@ -741,7 +741,7 @@ msgstr "下一步" #: dashboard/qml/WizardPage.qml:112 #, kde-format -msgid "How to enable developper mode" +msgid "How to enable developer mode" msgstr "如何啟用開發者模式" #: dashboard/qml/WizardPage.qml:119 @@ -808,7 +808,7 @@ msgstr "未安裝 ADB" msgid "" "

    No headset detected. Make sure that:\n" "

    " +"href=\"#\">developer mode

" msgstr "" "

未偵測到頭戴式裝置。請確認:\n" "