Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove debug ext only when added by loader #129

Merged
merged 4 commits into from Sep 10, 2019

Conversation

rpavlik
Copy link
Contributor

@rpavlik rpavlik commented Sep 4, 2019

Fixes #124 without the side-effects of the other approach (that is, this is an alternate to #123)

cc @yl-msft

This can be tested with Monado - the master branch reports the support for the extension (though it's not fully implemented), while https://gitlab.freedesktop.org/monado/monado/commits/no-debug-messenger has it disabled for testing purposes.

To test, you can modify hello_xr to require the debug extension as follows:

Find this code in openxr_program.cpp:

        // Create union of extensions required by platform and graphics plugins.
        std::vector<const char*> extensions;

and change it to this:

        // Create union of extensions required by platform and graphics plugins.
        std::vector<const char*> extensions = {XR_EXT_DEBUG_UTILS_EXTENSION_NAME};

Note that the InstanceCreateInfoManager is intended to be re-usable in other layers, etc that may have a need for pruning the extension list. Also, the current state in this branch is that the extension is removed from the create info even if there are layers that report support for it (none of the built-in ones do so despite actually working with it?) - this might need some fine-tuning. However, it will avoid spurious failures.

…oader.

Code is intended to be somewhat re-usable in other layers.
It's slightly less efficient, but this happens very rarely (just at instance creation)
and the lists of extensions and extensions-to-suppress are both very small,
so readability wins out over efficiency.
return Update();
}
// Remove the extension named in the parameter and return a pointer to the current state.
const XrInstanceCreateInfo* FilterOutExtension(const char* extension_to_skip) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it seems the Get() and FilterOutExtension (w/o 's') functions can be private.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are intended for use in "re-use" of this class elsewhere. e.g. if there's a layer providing an overlay extension, it would want to filter out just that extension before passing things down the line.

@rpavlik rpavlik merged commit ffcca49 into KhronosGroup:master Sep 10, 2019
@rpavlik rpavlik deleted the remove-debug-ext-loader branch September 10, 2019 22:15
rpavlik added a commit that referenced this pull request Oct 8, 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)
rhabacker pushed a commit to rhabacker/OpenXR-SDK-Source that referenced this pull request Nov 16, 2022
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xrCreateInstance failed when requesting XR_EXT_debug_util extension
2 participants