{"record":{"id":"601f45b25884e1fa","repo":"stride3d/stride","slug":"openxr-error-current-implementation-doesn-t-support-directx","errorCode":null,"errorMessage":"OpenXR error! Current implementation doesn't support directX 11","messagePattern":"OpenXR error! Current implementation doesn't support directX 11","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"sources/engine/Stride.VirtualReality/OpenXR/OpenXRHmd.cs","lineNumber":537,"sourceCode":"            };\n            swapImageCollected = (Xr.WaitSwapchainImage(globalSwapchain, in waitInfo) == Result.Success);\n            if(!swapImageCollected)\n            {\n                // Logger.Warning(\"WaitSwapchainImage failed\");\n                var releaseInfo = new SwapchainImageReleaseInfo()\n                {\n                    Type = StructureType.SwapchainImageReleaseInfo,\n                    Next = null,\n                };\n                Xr.ReleaseSwapchainImage(globalSwapchain, in releaseInfo).CheckResult();\n            }\n\n            return swapchainIndex;\n        }\n#else\n        public unsafe uint GetSwapchainImage()\n        {\n            throw new InvalidOperationException($\"OpenXR error! Current implementation doesn't support directX 11\");\n        }\n#endif\n\n        public override void Commit(CommandList commandList, Texture renderFrame)\n        {\n            if (baseDevice is null || projection_views is null || views is null)\n                return;\n\n#if STRIDE_GRAPHICS_API_DIRECT3D11\n            if (render_targets is null)\n                return;\n#endif\n\n            // if we didn't wait a frame, don't commit\n            if (begunFrame == false)\n                return;\n\n            begunFrame = false;","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.VirtualReality/OpenXR/OpenXRHmd.cs#L519-L555","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Switch the game's graphics backend to Direct3D12 in the game settings / device initialization.","Do not call GetSwapchainImage() when the backend is D3D11; guard with a graphics-API check.","Use a VR backend that matches your graphics API (or a non-OpenXR fallback) if D3D11 is a hard requirement."],"exampleFix":"// before\nvar image = hmd.GetSwapchainImage(); // throws on D3D11\n// after\nif (game.GraphicsDevice.Backend == GraphicsBackend.Direct3D12)\n{\n    var image = hmd.GetSwapchainImage();\n}","handlingStrategy":"validation","validationCode":"if (game.GraphicsDevice.Backend != GraphicsBackend.Direct3D12)\n    throw new PlatformNotSupportedException(\"OpenXR swapchain requires Direct3D12\");\nvar image = hmd.GetSwapchainImage();","typeGuard":null,"tryCatchPattern":"try { image = hmd.GetSwapchainImage(); }\ncatch (InvalidOperationException) { /* D3D11 build path; abort or switch backend */ }","preventionTips":["Configure the game to use the Direct3D12 graphics backend for OpenXR.","Never compile/run the OpenXR plugin against a D3D11 build path.","Check the graphics backend once at startup and fail fast with a clear message."],"tags":["openxr","vr","directx11","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}