KhronosGroup / OpenXR-SDK-Source

Sources for OpenXR loader, basic API layers, and example code.

Home Page:https://khronos.org/openxr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong calling convention for layers on 32-bit Windows

SEt-t opened this issue · comments

commented

Loader expects xrNegotiateLoaderApiLayerInterfaceto use __stdcall convention for Win32 target:

auto negotiate = reinterpret_cast<PFN_xrNegotiateLoaderApiLayerInterface>(

typedef XrResult(XRAPI_PTR *PFN_xrNegotiateLoaderApiLayerInterface)(const XrNegotiateLoaderInfo *loaderInfo,

But layer's code specifies no calling convention:

LAYER_EXPORT XrResult xrNegotiateLoaderApiLayerInterface(const XrNegotiateLoaderInfo *loaderInfo, const char * /*apiLayerName*/,

what results in use of default one (usually, __cdecl) and crash in loader due to convention mismatch.

An issue (number 1929) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#1929 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.

This was fixed in 1.0.27!