How to develope MR with d3d12 based on openXR?


I try to create session with d3d12, but it is not supported.

How to develope MR with d3d12 based on openXR? My Operating System is win10 18362. Thanks.

uint32_t extensionCount;
            CHECK_XRCMD(xrEnumerateInstanceExtensionProperties(nullptr, 0, &extensionCount, nullptr));
            std::vector<XrExtensionProperties> extensionProperties(extensionCount, {XR_TYPE_EXTENSION_PROPERTIES});
            CHECK_XRCMD(xrEnumerateInstanceExtensionProperties(nullptr, extensionCount, &extensionCount,;

            std::vector<const char*> enabledExtensions;

            // Add a specific extension to the list of extensions to be enabled, if it is supported.
            auto EnableExtentionIfSupported = [&](const char* extensionName) {
                for (uint32_t i = 0; i < extensionCount; i++) {
                    if (strcmp(extensionProperties[i].extensionName, extensionName) == 0) {
                        return true;
                return false;

            // check if it's supported.
CHECK(EnableExtentionIfSupported(XR_KHR_D3D11_ENABLE_EXTENSION_NAME));  // ok
CHECK(EnableExtentionIfSupported(XR_KHR_D3D12_ENABLE_EXTENSION_NAME)); // failed

Iā€™m not sure if D3D12 was supported by the Windows MR runtime at the time you posted this. I think it might be supported now, however?

Hi Ingo!

Microsoft has recently released preview version 2003 of the Windows Mixed Reality OpenXR Runtime that supports a broader set of extensions, including XR_KHR_D3D12_enable. We expect D3D12 support to move into our stable runtime soon!

Check out our doc pages for our extension roadmap and instructions for enabling the preview runtime.

1 Like

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.