stride3d/stride · critical · InvalidOperationException

OpenXR error! Current implementation doesn't support…

Error message

OpenXR error! Current implementation doesn't support directX 11

What it means

This is the DirectX 11 build path stub of OpenXRHmd.GetSwapchainImage(): the OpenXR swapchain implementation is only compiled for DirectX 12, so under the D3D11 graphics backend the method unconditionally throws InvalidOperationException. Calling it indicates a configuration where the OpenXR backend is combined with an unsupported graphics API. The swapchain image can only be retrieved when compiled against D3D12.

Solutions

  1. Switch the game's graphics backend to Direct3D12 in the game settings / device initialization.
  2. Do not call GetSwapchainImage() when the backend is D3D11; guard with a graphics-API check.
  3. Use a VR backend that matches your graphics API (or a non-OpenXR fallback) if D3D11 is a hard requirement.

Example fix

// before
var image = hmd.GetSwapchainImage(); // throws on D3D11
// after
if (game.GraphicsDevice.Backend == GraphicsBackend.Direct3D12)
{
    var image = hmd.GetSwapchainImage();
}
Defensive patterns

Strategy: validation

Validate before calling

if (game.GraphicsDevice.Backend != GraphicsBackend.Direct3D12)
    throw new PlatformNotSupportedException("OpenXR swapchain requires Direct3D12");
var image = hmd.GetSwapchainImage();

Try / catch

try { image = hmd.GetSwapchainImage(); }
catch (InvalidOperationException) { /* D3D11 build path; abort or switch backend */ }

Prevention

When it happens

Trigger: Running an OpenXR VR application configured with the D3D11 graphics backend and calling GetSwapchainImage(); building Stride with the #else branch of the OpenXR renderer and requesting swapchain images.

Common situations: Older project templates or assets defaulting to Direct3D11 while the VR/OpenXR plugin requires Direct3D12; switching graphics API in game settings without updating VR expectations.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14). Data as JSON: /api/errors/601f45b25884e1fa. Report an issue: GitHub.

Appendix: source

Thrown at sources/engine/Stride.VirtualReality/OpenXR/OpenXRHmd.cs:537

            };
            swapImageCollected = (Xr.WaitSwapchainImage(globalSwapchain, in waitInfo) == Result.Success);
            if(!swapImageCollected)
            {
                // Logger.Warning("WaitSwapchainImage failed");
                var releaseInfo = new SwapchainImageReleaseInfo()
                {
                    Type = StructureType.SwapchainImageReleaseInfo,
                    Next = null,
                };
                Xr.ReleaseSwapchainImage(globalSwapchain, in releaseInfo).CheckResult();
            }

            return swapchainIndex;
        }
#else
        public unsafe uint GetSwapchainImage()
        {
            throw new InvalidOperationException($"OpenXR error! Current implementation doesn't support directX 11");
        }
#endif

        public override void Commit(CommandList commandList, Texture renderFrame)
        {
            if (baseDevice is null || projection_views is null || views is null)
                return;

#if STRIDE_GRAPHICS_API_DIRECT3D11
            if (render_targets is null)
                return;
#endif

            // if we didn't wait a frame, don't commit
            if (begunFrame == false)
                return;

            begunFrame = false;

View on GitHub (pinned to 96fad776d2)