[Bf-blender-cvs] [e8f66ff0606] soc-2019-openxr: Update OpenXR to version 1.0

Julian Eisel noreply at git.blender.org
Wed Jul 31 02:20:30 CEST 2019


Commit: e8f66ff0606fea7cdaee1ab63563cbe9f6053960
Author: Julian Eisel
Date:   Wed Jul 31 00:34:46 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rBe8f66ff0606fea7cdaee1ab63563cbe9f6053960

Update OpenXR to version 1.0

Only tested on Windows.

Updates loader sources from the OpenXR SDK to latest 1.0 SDK and updates
requiremed version to 1.0. The compile time generation of files is a
thing of the past now (although you can still force it).
1.0 got released yesterday. Only one line needed fixing in our OpenXR
code to get it to compile. Rendering is black though.

For now I tried to keep edits to CMakeList.txt files minimal. So now
there are OpenXR CMake options exposed (with bad names), CMake prints,
etc.

===================================================================

M	build_files/cmake/Modules/xr_platform_defines.cmake
M	extern/openxr/CMakeLists.txt
D	extern/openxr/common/filesystem_utils.cpp
D	extern/openxr/common/gfxwrapper_opengl.c
D	extern/openxr/common/gfxwrapper_opengl.h
D	extern/openxr/common/platform_utils.hpp
A	extern/openxr/include/CMakeLists.txt
A	extern/openxr/include/openxr/CMakeLists.txt
M	extern/openxr/include/openxr/openxr.h
M	extern/openxr/include/openxr/openxr_platform.h
M	extern/openxr/include/openxr/openxr_platform_defines.h
A	extern/openxr/include/openxr/openxr_reflection.h
D	extern/openxr/loader/CMakeLists.txt
D	extern/openxr/loader/api_layer_interface.cpp
D	extern/openxr/loader/loader_core.cpp
D	extern/openxr/loader/loader_instance.cpp
D	extern/openxr/loader/loader_instance.hpp
D	extern/openxr/loader/loader_logger.cpp
D	extern/openxr/loader/manifest_file.cpp
D	extern/openxr/loader/runtime_interface.cpp
D	extern/openxr/loader/xr_generated_loader.cpp
A	extern/openxr/src/CMakeLists.txt
A	extern/openxr/src/cmake/FindVulkanHeaders.cmake
A	extern/openxr/src/cmake/cmake_uninstall.cmake.in
A	extern/openxr/src/cmake/presentation.cmake
A	extern/openxr/src/common/extra_algorithms.h
A	extern/openxr/src/common/filesystem_utils.cpp
R100	extern/openxr/common/filesystem_utils.hpp	extern/openxr/src/common/filesystem_utils.hpp
A	extern/openxr/src/common/hex_and_handles.cpp
A	extern/openxr/src/common/hex_and_handles.h
R098	extern/openxr/common/loader_interfaces.h	extern/openxr/src/common/loader_interfaces.h
A	extern/openxr/src/common/platform_utils.hpp
R078	extern/openxr/common/xr_dependencies.h	extern/openxr/src/common/xr_dependencies.h
R074	extern/openxr/common/xr_linear.h	extern/openxr/src/common/xr_linear.h
R057	extern/openxr/common_cmake_config.h.in	extern/openxr/src/common_cmake_config.h.in
A	extern/openxr/src/loader/CMakeLists.txt
A	extern/openxr/src/loader/api_layer_interface.cpp
R093	extern/openxr/loader/api_layer_interface.hpp	extern/openxr/src/loader/api_layer_interface.hpp
A	extern/openxr/src/loader/exception_handling.hpp
R100	extern/openxr/loader/loader.rc	extern/openxr/src/loader/loader.rc
A	extern/openxr/src/loader/loader_core.cpp
A	extern/openxr/src/loader/loader_instance.cpp
A	extern/openxr/src/loader/loader_instance.hpp
A	extern/openxr/src/loader/loader_logger.cpp
R064	extern/openxr/loader/loader_logger.hpp	extern/openxr/src/loader/loader_logger.hpp
A	extern/openxr/src/loader/loader_logger_recorders.cpp
A	extern/openxr/src/loader/loader_logger_recorders.hpp
R069	extern/openxr/loader/loader_platform.hpp	extern/openxr/src/loader/loader_platform.hpp
A	extern/openxr/src/loader/manifest_file.cpp
R084	extern/openxr/loader/manifest_file.hpp	extern/openxr/src/loader/manifest_file.hpp
R100	extern/openxr/loader/openxr.pc.in	extern/openxr/src/loader/openxr.pc.in
A	extern/openxr/src/loader/runtime_interface.cpp
R090	extern/openxr/loader/runtime_interface.hpp	extern/openxr/src/loader/runtime_interface.hpp
A	extern/openxr/src/loader/xr_generated_loader.cpp
R089	extern/openxr/loader/xr_generated_loader.hpp	extern/openxr/src/loader/xr_generated_loader.hpp
A	extern/openxr/src/version.cmake
R093	extern/openxr/xr_generated_dispatch_table.c	extern/openxr/src/xr_generated_dispatch_table.c
R093	extern/openxr/xr_generated_dispatch_table.h	extern/openxr/src/xr_generated_dispatch_table.h
R086	extern/openxr/xr_generated_utilities.c	extern/openxr/src/xr_generated_utilities.c
R091	extern/openxr/xr_generated_utilities.h	extern/openxr/src/xr_generated_utilities.h
M	intern/ghost/CMakeLists.txt
M	intern/ghost/intern/GHOST_XrSession.cpp

===================================================================

diff --git a/build_files/cmake/Modules/xr_platform_defines.cmake b/build_files/cmake/Modules/xr_platform_defines.cmake
index 728ca1dcbb0..cb1740a993d 100644
--- a/build_files/cmake/Modules/xr_platform_defines.cmake
+++ b/build_files/cmake/Modules/xr_platform_defines.cmake
@@ -1,28 +1,30 @@
-#=============================================================================
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Copyright (c) 2017 The Khronos Group Inc.
 #
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
 #
-# Inspired on the Testing.cmake from Libmv
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-#=============================================================================
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 
-# Determine the presentation backend for Linux systems.
-# Use an include because the code is pretty big.
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    include(presentation)
-endif()
-
 if(WIN32)
   add_definitions(-DXR_OS_WINDOWS)
 elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
   add_definitions(-DXR_OS_LINUX)
 endif()
 
+# Determine the presentation backend for Linux systems.
+# Use an include because the code is pretty big.
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    include(presentation)
+endif()
+
 # Several files use these compile-time platform switches
 if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
     add_definitions( -DXR_USE_PLATFORM_WIN32 )
diff --git a/extern/openxr/CMakeLists.txt b/extern/openxr/CMakeLists.txt
index eecf91df6a6..313ad11b380 100644
--- a/extern/openxr/CMakeLists.txt
+++ b/extern/openxr/CMakeLists.txt
@@ -1,50 +1,71 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
+# Copyright (c) 2017-2019 The Khronos Group Inc.
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
 #
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+#     http://www.apache.org/licenses/LICENSE-2.0
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 #
-# All rights reserved.
-# ***** END GPL LICENSE BLOCK *****
-
-set(MAJOR 0)
-set(MINOR 90)
-
-include(xr_platform_defines)
-
-include(CheckFunctionExists)
-CHECK_FUNCTION_EXISTS(secure_getenv HAVE_SECURE_GETENV)
-CHECK_FUNCTION_EXISTS(__secure_getenv HAVE___SECURE_GETENV)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/common_cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/common_cmake_config.h)
-
-set(OPENXR_SDK_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE INTERNAL "")
-
-add_custom_target(
-  generate_openxr_header
-  DEPENDS
-    ${OPENXR_SDK_INCLUDES}/openxr/openxr_platform_defines.h
-    ${OPENXR_SDK_INCLUDES}/openxr/openxr.h
-    ${OPENXR_SDK_INCLUDES}/openxr/openxr_platform.h
-    ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-add_custom_target(
-  xr_global_generated_files
-  DEPENDS
-    xr_generated_dispatch_table.h
-    xr_generated_dispatch_table.c
-    xr_generated_utilities.h
-    xr_generated_utilities.c
-)
-
-add_subdirectory(loader)
+# Author:
+#
+
+# Note: This is the top-level CMake file for the OpenXR project.
+# It should contain only definitions that are applicable to the
+# entire project and includes for the sub-directories.
+
+cmake_minimum_required(VERSION 3.0)
+project(OPENXR)
+
+#find_package(PythonInterp 3)
+
+# Enable IDE GUI folders.  "Helper targets" that don't have interesting source code should set their FOLDER property to this
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake predefined targets")
+set(LOADER_FOLDER "Loader")
+set(HELPER_FOLDER "Helpers")
+set(CODEGEN_FOLDER "Generated")
+set(TESTS_FOLDER "Tests")
+set(API_LAYERS_FOLDER "Layers")
+set(SAMPLES_FOLDER "Samples")
+
+option(BUILD_FORCE_GENERATION "Force re-generation of files even in the presence of pre-generated copies, replacing those copies." OFF)
+
+if(BUILD_FORCE_GENERATION AND NOT PYTHON_EXECUTABLE)
+    message(FATAL_ERROR "BUILD_FORCE_GENERATION requires Python")
+endif()
+
+set(OPENXR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+add_subdirectory(include)
+add_subdirectory(src)
+
+# uninstall target
+if(NOT TARGET uninstall)
+    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/cmake/cmake_uninstall.cmake.in"
+                   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+                   IMMEDIATE
+                   @ONLY)
+    add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+    set_target_properties(uninstall PROPERTIES FOLDER ${HELPER_FOLDER})
+endif()
+
+find_program(BASH_COMMAND NAMES bash)
+if(BASH_COMMAND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/specification/Makefile")
+    option(BUILD_SPECIFICATION "Run './makeAllExts all' in the specification directory as part of the build - intended for one-step checking of spec changes" OFF)
+    if(BUILD_SPECIFICATION)
+        add_custom_target(spec-all ALL
+            ${BASH_COMMAND} ./makeAllExts all
+            WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/specification"
+            VERBATIM
+            COMMENT "Running './makeAllExts all' in the specification directory"
+            USES_TERMINAL)
+    endif()
+endif()
+
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" DESTINATION share/doc/openxr)
diff --git a/extern/openxr/common/filesystem_utils.cpp b/extern/openxr/common/filesystem_utils.cpp
deleted file mode 100644
index 62e0b25cfc1..00000000000
--- a/extern/openxr/common/filesystem_utils.cpp
+++ /dev/null
@@ -1,454 +0,0 @@
-// Copyright (c) 2017 The Khronos Group Inc.
-// Copyright (c) 2017 Valve Corporation
-// Copyright (c) 2017 LunarG, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-// Authors: Mark Young <marky at lunarg.com>
-//          Nat Brown <natb at valvesoftware.com>
-//
-
-#include <cstring>
-
-// If the C++ macro is set to the version containing C++17, it must support
-// the final C++17 package
-#if __cplusplus >= 201703L
-#define USE_EXPERIMENTAL_FS 0
-#define USE_FINAL_FS 1
-
-#elif defined(XR_OS_WINDOWS)
-#if defined(_MSC_VER) && _MSC_VER >= 1900
-// MS VS 2015/2017 only supports the <experimental/filesystem> package.
-#define USE_EXPERIMENTAL_FS 1
-#define USE_FINAL_FS 0
-#else
-// MS VS 2010/2013 don't support either the final <filesystem or <experimental/filesystem>
-// packages.
-#define USE_EXPERIMENTAL_FS 0
-#define USE_FINAL_FS 0
-#endif
-
-// Right now, GCC still only supports the experimental filesystem items starting in GCC 6
-#elif (__GNUC__ >= 6)
-#define USE_EXPERIMENTAL_FS 1
-#define USE_FINAL_FS 0
-
-// If Clang, check for feature support
-#elif defined(__clang__) && (__cpp_lib_filesystem || __cpp_lib_experimental_filesystem)
-#if __cpp_lib_filesystem
-#define USE_EXPERIMENTAL_FS 0
-#define USE_FINAL_FS 1
-#else
-#define USE_EXPERIMENTAL_FS 1
-#define USE_FINAL_FS 0
-#endif
-
-// If all above fails, fall back to standard C++ and OS-specific items
-#else
-#define USE_EXPERIMENTAL_FS 0
-#define USE_FINAL_FS 0
-#endif
-
-#if USE_FINAL_FS == 1
-#include <filesystem>
-#define FS_PREFIX std::filesystem
-#elif USE_EXPERIMENTAL_FS == 1
-#include <experimental/filesystem>
-#define FS_PREFIX std::experimental::filesystem
-#elif defined(XR_OS_WINDOWS)
-// Windows fallback includes
-#include <stdint.h>
-#include <direct.h>
-#else
-// Linux/Apple fallback includes
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <dirent.h>
-#endif
-
-#include "filesystem_utils.hpp"
-
-#if defined(XR_OS_WINDOWS)
-#define PATH_SEPARATOR ';'
-#define DIRECTORY_SYMBOL '\\'
-#else
-#define PATH_SEPARATOR ':'
-#define DIRECTORY_SYMBOL '/'
-#endif
-
-#if (USE_FINAL_FS == 1) || (USE_EXPERIMENTAL_FS == 1)
-// We can use one of the C++ filesystem packages
-
-bool FileSysUtilsIsRegularFile(const std::string& path) {
-    try {
-        return FS_PREFIX::is_regular_file(path);
-    } catch (...) {
-        return false;
-    }
-}
-
-bool FileSysUtilsIsDirectory(const std::string& path) {
-    try {
-        return FS_PREFIX::is_directory(path);
-    } catch (...) {
-        return false;
-    }
-}
-
-bool FileSysUtilsPathExists(cons

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list