From 29cd5135a361ff76988c6809a7c6a11951597103 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 4 Mar 2021 16:15:50 +0300 Subject: [PATCH] wineopenxr: Sync DXVK queue in wine_xrEndFrame(). Signed-off-by: Paul Gofman --- wineopenxr/openxr.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wineopenxr/openxr.c b/wineopenxr/openxr.c index ea8a9fd2..dcc17f00 100644 --- a/wineopenxr/openxr.c +++ b/wineopenxr/openxr.c @@ -1654,8 +1654,10 @@ static XrCompositionLayerBaseHeader *convert_XrCompositionLayer(wine_XrSession * XrResult WINAPI wine_xrEndFrame(XrSession session, const XrFrameEndInfo *frameEndInfo) { wine_XrSession *wine_session = (wine_XrSession *)session; + IDXGIVkInteropDevice2 *dxvk_device; XrFrameEndInfo our_frameEndInfo; uint32_t i, view_idx = 0; + XrResult res; WINE_TRACE("%p, %p\n", session, frameEndInfo); @@ -1677,7 +1679,17 @@ XrResult WINAPI wine_xrEndFrame(XrSession session, const XrFrameEndInfo *frameEn our_frameEndInfo = *frameEndInfo; our_frameEndInfo.layers = (const XrCompositionLayerBaseHeader *const *)wine_session->composition_layer_ptrs; - return xrEndFrame(((wine_XrSession *)session)->session, &our_frameEndInfo); + if ((dxvk_device = wine_session->wine_instance->dxvk_device)) + { + WINE_TRACE("Locking submission queue.\n"); + dxvk_device->lpVtbl->FlushRenderingCommands(dxvk_device); + dxvk_device->lpVtbl->LockSubmissionQueue(dxvk_device); + } + res = xrEndFrame(((wine_XrSession *)session)->session, &our_frameEndInfo); + if (dxvk_device) + dxvk_device->lpVtbl->ReleaseSubmissionQueue(dxvk_device); + + return res; } /* wineopenxr API */