Skip to content

Commit

Permalink
OpenXR 1.0.3 release (7-October-2019)
Browse files Browse the repository at this point in the history
Patch release for the 1.0 series.

Note that this release includes changes to adjust the symbol exports from
dynamic library versions of the loader to align with the specification. Only
**core** symbols are currently exported. All extension symbols must be retrieved
using `xrGetInstanceProcAddr`.

### GitHub Pull Requests

These had been integrated into the public repo incrementally.

- General, Build, Other
  - KhronosGroup#139 - Write output atomically at the end of generator scripts
  - KhronosGroup#119 - Loader test updates.
  - KhronosGroup#116 - Static analysis cleanups.
- Loader
  - KhronosGroup#140 - Permit broader valid usage re: layers
  - KhronosGroup#133 - Remove shwapi dependency
  - KhronosGroup#132 - Fix directory searching for layers
  - KhronosGroup#130 - Fix exporting of symbols on Windows.
  - KhronosGroup#129 - Remove debug ext only when added by loader - fixes usage of debug ext
    on runtimes that do not provide it themselves.
  - KhronosGroup#125 - Include a `OutputDebugString` logger for Win32
- Layers
  - KhronosGroup#138 - Don't validate output enum buffer values
  - KhronosGroup#137 - Fix incorrect filenames in the generated API layer JSON

### Internal issues

- General, Build, Other
  - Fix warnings in MSVC static code analysis mode (internal MR 1574)
  - Validation layer improvements and fixes (internal MR 1568)
  - Update vendored jsoncpp to 1.9.1 (internal MR 1523)
- Loader
  - Add ability to quiet the loader's default output (internal MR 1576)
  - Fix conformance of loader in `xrEnumerateApiLayerProperties`/`xrEnumerateInstanceExtensionProperties`
- hello_xr
  - Simplify action usage in hello_xr (internal MR 1553)
- Registry
  - Add `XR_EXT_view_configuration_depth_range` extension (internal MR 1502, internal issue 1201)
  - Reserve a Monado extension (internal MR 1541)
  • Loading branch information
rpavlik committed Oct 8, 2019
1 parent 69bb150 commit 2bcc4fe
Show file tree
Hide file tree
Showing 98 changed files with 3,997 additions and 4,628 deletions.
46 changes: 45 additions & 1 deletion CHANGELOG.SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,50 @@ along with any public pull requests that have been accepted.
In this repository in particular, since it is primarily software,
pull requests may be integrated as they are accepted even between periodic updates.

## OpenXR 1.0.3 release (7-October-2019)

Patch release for the 1.0 series.

Note that this release includes changes to adjust the symbol exports from
dynamic library versions of the loader to align with the specification. Only
**core** symbols are currently exported. All extension symbols must be retrieved
using `xrGetInstanceProcAddr`.

### GitHub Pull Requests

These had been integrated into the public repo incrementally.

- General, Build, Other
- #139 - Write output atomically at the end of generator scripts
- #119 - Loader test updates.
- #116 - Static analysis cleanups.
- Loader
- #140 - Permit broader valid usage re: layers
- #133 - Remove shwapi dependency
- #132 - Fix directory searching for layers
- #130 - Fix exporting of symbols on Windows.
- #129 - Remove debug ext only when added by loader - fixes usage of debug ext
on runtimes that do not provide it themselves.
- #125 - Include a `OutputDebugString` logger for Win32
- Layers
- #138 - Don't validate output enum buffer values
- #137 - Fix incorrect filenames in the generated API layer JSON

### Internal issues

- General, Build, Other
- Fix warnings in MSVC static code analysis mode (internal MR 1574)
- Validation layer improvements and fixes (internal MR 1568)
- Update vendored jsoncpp to 1.9.1 (internal MR 1523)
- Loader
- Add ability to quiet the loader's default output (internal MR 1576)
- Fix conformance of loader in `xrEnumerateApiLayerProperties`/`xrEnumerateInstanceExtensionProperties`
- hello_xr
- Simplify action usage in hello_xr (internal MR 1553)
- Registry
- Add `XR_EXT_view_configuration_depth_range` extension (internal MR 1502, internal issue 1201)
- Reserve a Monado extension (internal MR 1541)

## OpenXR 1.0.2 release (27-August-2019)

Patch release for the 1.0 series.
Expand Down Expand Up @@ -56,7 +100,7 @@ These had been integrated into the public repo incrementally.
- Reserve additional extension number for Oculus. (Internal MR 1517)
- Loader
- **Security fix**: Do not use HKEY_CURRENT_USER or environment variables when
running as a medium-integrity process or higher on Windows.
the process is running higher than medium-integrity on Windows.
(Internal issue 1205, internal MR 1511)
- Small updates to the loader documentation.

Expand Down
17 changes: 16 additions & 1 deletion include/openxr/openxr.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {
((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL))

// OpenXR current version number.
#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 2)
#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 3)

#define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL)
#define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL)
Expand Down Expand Up @@ -280,6 +280,7 @@ typedef enum XrStructureType {
XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR = 1000031001,
XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT = 1000039000,
XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT = 1000039001,
XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000,
XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
} XrStructureType;

Expand Down Expand Up @@ -1590,6 +1591,20 @@ XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorMSFT(
#define XR_OCULUS_android_session_state_enable_SPEC_VERSION 1
#define XR_OCULUS_ANDROID_SESSION_STATE_ENABLE_EXTENSION_NAME "XR_OCULUS_android_session_state_enable"


#define XR_EXT_view_configuration_depth_range 1
#define XR_EXT_view_configuration_depth_range_SPEC_VERSION 1
#define XR_EXT_VIEW_CONFIGURATION_DEPTH_RANGE_EXTENSION_NAME "XR_EXT_view_configuration_depth_range"
typedef struct XrViewConfigurationDepthRangeEXT {
XrStructureType type;
void* XR_MAY_ALIAS next;
float recommendedNearZ;
float minNearZ;
float recommendedFarZ;
float maxFarZ;
} XrViewConfigurationDepthRangeEXT;


#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 0 additions & 4 deletions include/openxr/openxr_platform_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ extern "C" {
* Function pointer type: typedef void (XRAPI_PTR *PFN_xrFunction)(void);
*/
#if defined(_WIN32)
#ifdef XRAPI_DLL_EXPORT
#define XRAPI_ATTR __declspec(dllexport)
#else
#define XRAPI_ATTR
#endif
// On Windows, functions use the stdcall convention
#define XRAPI_CALL __stdcall
#define XRAPI_PTR XRAPI_CALL
Expand Down
9 changes: 9 additions & 0 deletions include/openxr/openxr_reflection.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR, 1000031001) \
_(XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT, 1000039000) \
_(XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT, 1000039001) \
_(XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT, 1000046000) \
_(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF)

#define XR_LIST_ENUM_XrFormFactor(_) \
Expand Down Expand Up @@ -1015,6 +1016,14 @@ XR_ENUM_STR(XrResult);
_(anchor) \
_(poseInAnchorSpace)

#define XR_LIST_STRUCT_XrViewConfigurationDepthRangeEXT(_) \
_(type) \
_(next) \
_(recommendedNearZ) \
_(minNearZ) \
_(recommendedFarZ) \
_(maxFarZ)




Expand Down
34 changes: 31 additions & 3 deletions specification/registry/xr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
<tag name="INTEL" author="Intel" contact="Javier Martinez @javier"/>
<tag name="KHR" author="Khronos" contact="Nick Whiting @whitingn"/>
<tag name="LUNARG" author="LunarG" contact="Mark Young @marky_lunarg, Karl Schultz @karlschultz"/>
<tag name="MAGICLEAP" author="Magic Leap" contact="Blake Taylor @theblindprogramm3r"/>
<tag name="MND" author="Monado Project" contact="Ryan Pavlik @rpavlik"/>
<tag name="MSFT" author="Microsoft" contact="Alex Turner @alexturn, Yin Li @yl_msft, Bryce Hutchings @brycehutchings, Lachlan Ford @laford_msft, Minmin Gong @gongminmin "/>
<tag name="NV" author="NVIDIA Corporation" contact="Satish Salian @ssalian, Robert Menzel"/>
Expand Down Expand Up @@ -112,7 +113,7 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
updates them automatically by processing a line at a time.
-->
<type category="define">// OpenXR current version number.
#define <name>XR_CURRENT_API_VERSION</name> <type>XR_MAKE_VERSION</type>(1, 0, 2)</type>
#define <name>XR_CURRENT_API_VERSION</name> <type>XR_MAKE_VERSION</type>(1, 0, 3)</type>

<!--
NOTE: For avoidance of ambiguity, there should only be 1 <name> tag immediately in
Expand Down Expand Up @@ -958,6 +959,16 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
<member><type>D3D_FEATURE_LEVEL</type> <name>minFeatureLevel</name></member>
</type>

<!-- struct types for XR_EXT_view_configuration_depth_range -->
<type category="struct" name="XrViewConfigurationDepthRangeEXT" structextends="XrViewConfigurationView">
<member values="XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT"><type>XrStructureType</type> <name>type</name></member>
<member><type>void</type>* <name>next</name></member>
<member><type>float</type> <name>recommendedNearZ</name></member>
<member><type>float</type> <name>minNearZ</name></member>
<member><type>float</type> <name>recommendedFarZ</name></member>
<member><type>float</type> <name>maxFarZ</name></member>
</type>

<!-- The PFN_xrVoidFunction type are used by XrGetInstanceProcAddr below -->
<type category="funcpointer">typedef void (XRAPI_PTR *<name>PFN_xrVoidFunction</name>)(void);</type>

Expand Down Expand Up @@ -1025,7 +1036,7 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
<enum value="4" name="XR_TYPE_SYSTEM_GET_INFO"/>
<enum value="5" name="XR_TYPE_SYSTEM_PROPERTIES"/>
<enum value="6" name="XR_TYPE_VIEW_LOCATE_INFO"/>
<enum value="7" name="XR_TYPE_VIEW"/>
<enum value="7" name="XR_TYPE_VIEW"/>
<enum value="8" name="XR_TYPE_SESSION_CREATE_INFO"/>
<enum value="9" name="XR_TYPE_SWAPCHAIN_CREATE_INFO"/>
<enum value="10" name="XR_TYPE_SESSION_BEGIN_INFO"/>
Expand Down Expand Up @@ -1063,7 +1074,7 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
<enum value="56" name="XR_TYPE_SWAPCHAIN_IMAGE_WAIT_INFO"/>
<enum value="57" name="XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO"/>
<enum value="58" name="XR_TYPE_ACTION_STATE_GET_INFO"/>
<enum value="59" name="XR_TYPE_HAPTIC_ACTION_INFO"/>
<enum value="59" name="XR_TYPE_HAPTIC_ACTION_INFO"/>
<enum value="60" name="XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO"/>
<enum value="61" name="XR_TYPE_ACTIONS_SYNC_INFO"/>
<enum value="62" name="XR_TYPE_BOUND_SOURCES_FOR_ACTION_ENUMERATE_INFO"/>
Expand Down Expand Up @@ -2031,6 +2042,7 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
</require>
</extension>


<!-- Vulkan image format list extension -->
<extension name="XR_KHR_vulkan_swapchain_format_list" number="15" type="instance" requires="XR_KHR_vulkan_enable" supported="openxr" protect="XR_USE_GRAPHICS_API_VULKAN">
<require>
Expand Down Expand Up @@ -2359,5 +2371,21 @@ maintained in the master branch of the Khronos OpenXR GitHub project.
</require>
</extension>

<extension name="XR_MND_extension_46" number="46" type="instance" supported="disabled">
<require>
<enum value="1" name="XR_MND_extension_46_SPEC_VERSION"/>
<enum value="&quot;XR_MND_extension_46&quot;" name="XR_MND_EXTENSION_46_EXTENSION_NAME"/>
</require>
</extension>

<extension name="XR_EXT_view_configuration_depth_range" number="47" type="instance" supported="openxr">
<require>
<enum value="1" name="XR_EXT_view_configuration_depth_range_SPEC_VERSION"/>
<enum value="&quot;XR_EXT_view_configuration_depth_range&quot;" name="XR_EXT_VIEW_CONFIGURATION_DEPTH_RANGE_EXTENSION_NAME"/>
<enum offset="0" extends="XrStructureType" name="XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT"/>
<type name="XrViewConfigurationDepthRangeEXT"/>
</require>
</extension>

</extensions>
</registry>
20 changes: 15 additions & 5 deletions src/common/filesystem_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,20 @@ bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::strin
#elif defined(XR_OS_WINDOWS)

// For pre C++17 compiler that doesn't support experimental filesystem
#include <shlwapi.h>

bool FileSysUtilsIsRegularFile(const std::string& path) { return (1 != PathIsDirectoryW(utf8_to_wide(path).c_str())); }
bool FileSysUtilsIsRegularFile(const std::string& path) {
const DWORD attr = GetFileAttributesW(utf8_to_wide(path).c_str());
return attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY);
}

bool FileSysUtilsIsDirectory(const std::string& path) { return (1 == PathIsDirectoryW(utf8_to_wide(path).c_str())); }
bool FileSysUtilsIsDirectory(const std::string& path) {
const DWORD attr = GetFileAttributesW(utf8_to_wide(path).c_str());
return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY);
}

bool FileSysUtilsPathExists(const std::string& path) { return (1 == PathFileExistsW(utf8_to_wide(path).c_str())); }
bool FileSysUtilsPathExists(const std::string& path) {
return (GetFileAttributesW(utf8_to_wide(path).c_str()) != INVALID_FILE_ATTRIBUTES);
}

bool FileSysUtilsIsAbsolutePath(const std::string& path) {
if ((path[0] == '\\') || (path[1] == ':' && (path[2] == '\\' || path[2] == '/'))) {
Expand Down Expand Up @@ -223,8 +230,11 @@ bool FileSysUtilsParsePathList(std::string& path_list, std::vector<std::string>&
}

bool FileSysUtilsFindFilesInPath(const std::string& path, std::vector<std::string>& files) {
std::string searchPath;
FileSysUtilsCombinePaths(path, "*", searchPath);

WIN32_FIND_DATAW file_data;
HANDLE file_handle = FindFirstFileW(utf8_to_wide(path).c_str(), &file_data);
HANDLE file_handle = FindFirstFileW(utf8_to_wide(searchPath).c_str(), &file_data);
if (file_handle != INVALID_HANDLE_VALUE) {
do {
if (!(file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
Expand Down
4 changes: 2 additions & 2 deletions src/common/hex_and_handles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
std::string Uint64ToHexString(uint64_t val) {
std::ostringstream oss;
oss << "0x";
oss << std::hex << std::setw(16) << std::setfill('0') << val;
oss << std::hex << std::setw(sizeof(val) * 2) << std::setfill('0') << val;
return oss.str();
}

std::string Uint32ToHexString(uint32_t val) {
std::ostringstream oss;
oss << "0x";
oss << std::hex << std::setw(8) << std::setfill('0') << val;
oss << std::hex << std::setw(sizeof(val) * 2) << std::setfill('0') << val;
return oss.str();
}
60 changes: 32 additions & 28 deletions src/common/object_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// limitations under the License.
//
// Author: Mark Young <[email protected]>, Ryan Pavlik <[email protected]>
// Author: Dave Houlton <[email protected]>
//

#include "object_info.h"
Expand All @@ -32,6 +33,8 @@
#include <string>
#include <vector>

#include "memory.h"

std::string XrSdkLogObjectInfo::ToString() const {
std::ostringstream oss;
oss << Uint64ToHexString(handle);
Expand Down Expand Up @@ -238,44 +241,45 @@ NamesAndLabels DebugUtilsData::PopulateNamesAndLabels(std::vector<XrSdkLogObject
return {objects, labels};
}

AugmentedCallbackData DebugUtilsData::AugmentCallbackData(
const XrDebugUtilsMessengerCallbackDataEXT& provided_callback_data) const {
AugmentedCallbackData ret{provided_callback_data};
if (object_info_.Empty() || provided_callback_data.objectCount == 0) {
return ret;
void DebugUtilsData::WrapCallbackData(AugmentedCallbackData* aug_data,
const XrDebugUtilsMessengerCallbackDataEXT* callback_data) const {
// If there's nothing to add, just return the original data as the augmented copy
aug_data->exported_data = callback_data;
if (object_info_.Empty() || callback_data->objectCount == 0) {
return;
}
bool obj_name_found = false;
for (uint32_t obj = 0; obj < provided_callback_data.objectCount; ++obj) {
auto& current_obj = provided_callback_data.objects[obj];
if (!obj_name_found) {
auto lookup = object_info_.LookUpStoredObjectInfo(current_obj.objectHandle, current_obj.objectType);
if (lookup != nullptr) {
obj_name_found = true;
}
}

// If this is a session, see if there are any labels associated with it for us to add
// to the callback content.
// Inspect each of the callback objects
bool name_found = false;
for (uint32_t obj = 0; obj < callback_data->objectCount; ++obj) {
auto& current_obj = callback_data->objects[obj];
name_found |= (nullptr != object_info_.LookUpStoredObjectInfo(current_obj.objectHandle, current_obj.objectType));

// If this is a session, record any labels associated with it
if (XR_OBJECT_TYPE_SESSION == current_obj.objectType) {
XrSession session = TreatIntegerAsHandle<XrSession>(current_obj.objectHandle);
LookUpSessionLabels(session, ret.labels);
LookUpSessionLabels(session, aug_data->labels);
}
}

if (!obj_name_found && ret.labels.empty()) {
// nothing to add to the data
return ret;
// If we found nothing to add, return the original data
if (!name_found && aug_data->labels.empty()) {
return;
}

// If a name or a label has been found, we should update it in a new version of the callback data
ret.new_objects.assign(provided_callback_data.objects, provided_callback_data.objects + provided_callback_data.objectCount);
// Found additional data - modify an internal copy and return that as the exported data
memcpy(&aug_data->modified_data, callback_data, sizeof(XrDebugUtilsMessengerCallbackDataEXT));
aug_data->new_objects.assign(callback_data->objects, callback_data->objects + callback_data->objectCount);

for (auto& obj : ret.new_objects) {
// Record (overwrite) the names of all incoming objects provided in our internal list
for (auto& obj : aug_data->new_objects) {
object_info_.LookUpObjectName(obj);
}
ret.temporary_callback_data.objects = ret.new_objects.data();
ret.temporary_callback_data.sessionLabelCount = static_cast<uint32_t>(ret.labels.size());
ret.temporary_callback_data.sessionLabels = ret.labels.empty() ? nullptr : ret.labels.data();
ret.callback_data_to_use = &ret.temporary_callback_data;
return ret;

// Update local copy & point export to it
aug_data->modified_data.objects = aug_data->new_objects.data();
aug_data->modified_data.sessionLabelCount = static_cast<uint32_t>(aug_data->labels.size());
aug_data->modified_data.sessionLabels = aug_data->labels.empty() ? nullptr : aug_data->labels.data();
aug_data->exported_data = &aug_data->modified_data;
return;
}
11 changes: 5 additions & 6 deletions src/common/object_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,12 @@ struct NamesAndLabels {
};

struct AugmentedCallbackData {
explicit AugmentedCallbackData(const XrDebugUtilsMessengerCallbackDataEXT& data_to_use)
: temporary_callback_data(data_to_use), callback_data_to_use(&data_to_use) {}
std::vector<XrDebugUtilsLabelEXT> labels;
XrDebugUtilsMessengerCallbackDataEXT temporary_callback_data;
std::vector<XrDebugUtilsObjectNameInfoEXT> new_objects;

const XrDebugUtilsMessengerCallbackDataEXT* callback_data_to_use;
XrDebugUtilsMessengerCallbackDataEXT modified_data;
const XrDebugUtilsMessengerCallbackDataEXT* exported_data;
};

/// Tracks all the data (handle names and session labels) required to fully augment XR_EXT_debug_utils-related calls.
class DebugUtilsData {
public:
Expand Down Expand Up @@ -225,7 +223,8 @@ class DebugUtilsData {
/// Given the collection of objects, populate their names and list of labels
NamesAndLabels PopulateNamesAndLabels(std::vector<XrSdkLogObjectInfo> objects) const;

AugmentedCallbackData AugmentCallbackData(const XrDebugUtilsMessengerCallbackDataEXT& provided_callback_data) const;
void WrapCallbackData(AugmentedCallbackData* aug_data,
const XrDebugUtilsMessengerCallbackDataEXT* provided_callback_data) const;

private:
void RemoveIndividualLabel(XrSdkSessionLabelList& label_vec);
Expand Down
Loading

0 comments on commit 2bcc4fe

Please sign in to comment.