wineopenxr: Lock d3d11 device in xrBeginFrame().

CW-Bug-Id: #23491
This commit is contained in:
Paul Gofman 2024-05-01 15:38:12 -06:00 committed by Arkadiusz Hiler
parent 5a996971d7
commit cce9c8b308
4 changed files with 18 additions and 9 deletions

View File

@ -175,6 +175,7 @@ FUNCTION_OVERRIDES = {
"xrCreateSwapchain" : {"dispatch" : True, "driver" : True, "thunk" : False},
"xrDestroySwapchain" : {"dispatch" : True, "driver" : True, "thunk" : False},
"xrEndFrame" : {"dispatch" : True, "driver" : True, "thunk" : False},
"xrBeginFrame" : {"dispatch" : True, "driver" : True, "thunk" : False},
}
NOT_OUR_FUNCTIONS = [

View File

@ -1878,6 +1878,22 @@ XrResult WINAPI wine_xrEndFrame(XrSession session, const XrFrameEndInfo *frameEn
return res;
}
XrResult WINAPI wine_xrBeginFrame(XrSession session, const XrFrameBeginInfo *frameBeginInfo)
{
wine_XrSession *wine_session = (wine_XrSession *)session;
IDXGIVkInteropDevice2 *dxvk_device;
XrResult ret;
WINE_TRACE("%p, %p\n", session, frameBeginInfo);
if ((dxvk_device = wine_session->wine_instance->dxvk_device))
dxvk_device->lpVtbl->LockSubmissionQueue(dxvk_device);
ret = xrBeginFrame(((wine_XrSession *)session)->session, frameBeginInfo);
if (dxvk_device)
dxvk_device->lpVtbl->ReleaseSubmissionQueue(dxvk_device);
return ret;
}
/* wineopenxr API */
XrResult WINAPI __wineopenxr_GetVulkanInstanceExtensions(uint32_t buflen, uint32_t *outlen, char *buf)
{

View File

@ -207,15 +207,6 @@ XrResult WINAPI wine_xrAttachSessionActionSets(XrSession session, const XrSessio
return ret;
}
XrResult WINAPI wine_xrBeginFrame(XrSession session, const XrFrameBeginInfo *frameBeginInfo)
{
XrResult ret;
WINE_TRACE("%p, %p\n", session, frameBeginInfo);
ret = xrBeginFrame(((wine_XrSession *)session)->session, frameBeginInfo);
return ret;
}
static XrResult WINAPI wine_xrBeginPlaneDetectionEXT(XrPlaneDetectorEXT planeDetector, const XrPlaneDetectorBeginInfoEXT *beginInfo)
{
XrResult ret;

View File

@ -25,6 +25,7 @@
#define WINE_XR_VERSION XR_API_VERSION_1_1
/* Functions for which we have custom implementations outside of the thunks. */
XrResult WINAPI wine_xrBeginFrame(XrSession session, const XrFrameBeginInfo *frameBeginInfo);
XrResult WINAPI wine_xrConvertTimeToWin32PerformanceCounterKHR(XrInstance instance, XrTime time, LARGE_INTEGER *performanceCounter);
XrResult WINAPI wine_xrConvertWin32PerformanceCounterToTimeKHR(XrInstance instance, const LARGE_INTEGER *performanceCounter, XrTime *time);
XrResult WINAPI wine_xrCreateApiLayerInstance(const XrInstanceCreateInfo *info, const XrApiLayerCreateInfo *layerInfo, XrInstance *instance);