From c8bdfae83eb52d96757ea8b25252b8bd788f4de0 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Wed, 2 Dec 2020 14:18:00 +0100 Subject: [PATCH] src: Consistently append 1 to equirect1 code. Rename XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY to XRT_FEATURE_OPENXR_LAYER_EQUIRECT1. Use correct define in verify_equirect1_layer function. Rename equirect to equirect1. meson: enable equirect1 by default. --- CMakeLists.txt | 6 ++-- meson_options.txt | 6 ++-- scripts/generate_oxr_ext_support.py | 2 +- src/xrt/include/xrt/meson.build | 4 +-- .../include/xrt/xrt_config_build.h.cmake_in | 2 +- .../oxr/oxr_extension_support.h | 2 +- src/xrt/state_trackers/oxr/oxr_session.c | 32 +++++++++---------- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f0d39b22..ab7aaa9fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,8 +147,8 @@ endif() if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_EQUIRECT2) set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT2 ON) endif() -if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY) - set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY OFF) +if(NOT DEFINED XRT_FEATURE_OPENXR_LAYER_EQUIRECT1) + set(XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 OFF) endif() # Most users won't touch these. @@ -304,7 +304,7 @@ message(STATUS "# FEATURE_OPENXR_LAYER_DEPTH: ${XRT_FEATURE_OPENXR_ message(STATUS "# FEATURE_OPENXR_LAYER_CUBE: ${XRT_FEATURE_OPENXR_LAYER_CUBE}") message(STATUS "# FEATURE_OPENXR_LAYER_CYLINDER: ${XRT_FEATURE_OPENXR_LAYER_CYLINDER}") message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT2: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT2}") -message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY}") +message(STATUS "# FEATURE_OPENXR_LAYER_EQUIRECT1: ${XRT_FEATURE_OPENXR_LAYER_EQUIRECT1}") message(STATUS "# FEATURE_STEAMVR_PLUGIN: ${XRT_FEATURE_STEAMVR_PLUGIN}") message(STATUS "#") message(STATUS "# DRIVER_ANDROID: ${XRT_BUILD_DRIVER_ANDROID}") diff --git a/meson_options.txt b/meson_options.txt index 75167d023..77110cad6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -96,10 +96,10 @@ option('layer_cylinder', description: 'Enable support for Cylinder Layers' ) -option('layer_equirect', +option('layer_equirect1', type: 'boolean', - value: false, - description: 'Enable support for Equirect Layers' + value: true, + description: 'Enable support for legacy Equirect Layers' ) option('layer_equirect2', diff --git a/scripts/generate_oxr_ext_support.py b/scripts/generate_oxr_ext_support.py index 368b172f5..5ad26408e 100755 --- a/scripts/generate_oxr_ext_support.py +++ b/scripts/generate_oxr_ext_support.py @@ -18,7 +18,7 @@ EXTENSIONS = ( ['XR_KHR_composition_layer_depth', 'XRT_FEATURE_OPENXR_LAYER_DEPTH'], ['XR_KHR_composition_layer_cube', 'XRT_FEATURE_OPENXR_LAYER_CUBE'], ['XR_KHR_composition_layer_cylinder', 'XRT_FEATURE_OPENXR_LAYER_CYLINDER'], - ['XR_KHR_composition_layer_equirect', 'XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY'], + ['XR_KHR_composition_layer_equirect', 'XRT_FEATURE_OPENXR_LAYER_EQUIRECT1'], ['XR_KHR_composition_layer_equirect2', 'XRT_FEATURE_OPENXR_LAYER_EQUIRECT2'], ['XR_EXT_debug_utils'], ['XR_MND_headless'], diff --git a/src/xrt/include/xrt/meson.build b/src/xrt/include/xrt/meson.build index 502c9e173..ea5d87d64 100644 --- a/src/xrt/include/xrt/meson.build +++ b/src/xrt/include/xrt/meson.build @@ -93,8 +93,8 @@ if get_option('layer_cylinder') have_conf.set('XRT_FEATURE_OPENXR_LAYER_CYLINDER', true) endif -if get_option('layer_equirect') - have_conf.set('XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY', true) +if get_option('layer_equirect1') + have_conf.set('XRT_FEATURE_OPENXR_LAYER_EQUIRECT1', true) endif if get_option('layer_equirect2') diff --git a/src/xrt/include/xrt/xrt_config_build.h.cmake_in b/src/xrt/include/xrt/xrt_config_build.h.cmake_in index 7bdd66d85..b9f89a0ab 100644 --- a/src/xrt/include/xrt/xrt_config_build.h.cmake_in +++ b/src/xrt/include/xrt/xrt_config_build.h.cmake_in @@ -23,4 +23,4 @@ #cmakedefine XRT_FEATURE_OPENXR_LAYER_EQUIRECT2 -#cmakedefine XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY +#cmakedefine XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 diff --git a/src/xrt/state_trackers/oxr/oxr_extension_support.h b/src/xrt/state_trackers/oxr/oxr_extension_support.h index 097715c87..3f262491a 100644 --- a/src/xrt/state_trackers/oxr/oxr_extension_support.h +++ b/src/xrt/state_trackers/oxr/oxr_extension_support.h @@ -123,7 +123,7 @@ * XR_KHR_composition_layer_equirect */ #if defined(XR_KHR_composition_layer_equirect) && \ - defined(XRT_FEATURE_OPENXR_LAYER_EQUIRECT_LEGACY) + defined(XRT_FEATURE_OPENXR_LAYER_EQUIRECT1) #define OXR_HAVE_KHR_composition_layer_equirect #define OXR_EXTENSION_SUPPORT_KHR_composition_layer_equirect(_) \ _(KHR_composition_layer_equirect, KHR_COMPOSITION_LAYER_EQUIRECT) diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index 34b74d83b..c23450dd1 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -1217,14 +1217,14 @@ verify_cylinder_layer(struct xrt_compositor *xc, } static XrResult -verify_equirect_layer(struct xrt_compositor *xc, - struct oxr_logger *log, - uint32_t layer_index, - const XrCompositionLayerEquirectKHR *equirect, - struct xrt_device *head, - uint64_t timestamp) +verify_equirect1_layer(struct xrt_compositor *xc, + struct oxr_logger *log, + uint32_t layer_index, + const XrCompositionLayerEquirectKHR *equirect, + struct xrt_device *head, + uint64_t timestamp) { -#ifndef XRT_FEATURE_OPENXR_LAYER_EQUIRECT2 +#ifndef XRT_FEATURE_OPENXR_LAYER_EQUIRECT1 return oxr_error(log, XR_ERROR_LAYER_INVALID, "(frameEndInfo->layers[%u]->type) layer type " "XrCompositionLayerEquirectKHR not supported", @@ -1799,13 +1799,13 @@ submit_cylinder_layer(struct oxr_session *sess, } static void -submit_equirect_layer(struct oxr_session *sess, - struct xrt_compositor *xc, - struct oxr_logger *log, - const XrCompositionLayerEquirectKHR *equirect, - struct xrt_device *head, - struct xrt_pose *inv_offset, - uint64_t timestamp) +submit_equirect1_layer(struct oxr_session *sess, + struct xrt_compositor *xc, + struct oxr_logger *log, + const XrCompositionLayerEquirectKHR *equirect, + struct xrt_device *head, + struct xrt_pose *inv_offset, + uint64_t timestamp) { // Not implemented } @@ -2016,7 +2016,7 @@ oxr_session_frame_end(struct oxr_logger *log, xdev, frameEndInfo->displayTime); break; case XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR: - res = verify_equirect_layer( + res = verify_equirect1_layer( xc, log, i, (XrCompositionLayerEquirectKHR *)layer, xdev, frameEndInfo->displayTime); break; @@ -2081,7 +2081,7 @@ oxr_session_frame_end(struct oxr_logger *log, &inv_offset, timestamp); break; case XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR: - submit_equirect_layer( + submit_equirect1_layer( sess, xc, log, (XrCompositionLayerEquirectKHR *)layer, xdev, &inv_offset, timestamp);