d3d12: Only support DXGI and GDI APIs on Windows

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
This commit is contained in:
Jesse Natalie
2020-12-08 10:58:16 -08:00
committed by Marge Bot
parent ed286325a0
commit ee4c80f77d
3 changed files with 9 additions and 1 deletions

View File

@@ -633,9 +633,12 @@ d3d12_flush_frontbuffer(struct pipe_screen * pscreen,
winsys->displaytarget_unmap(winsys, res->dt);
}
#ifdef _WIN32
// WindowFromDC is Windows-only, and this method requires an HWND, so only use it on Windows
ID3D12SharingContract *sharing_contract;
if (SUCCEEDED(screen->cmdqueue->QueryInterface(IID_PPV_ARGS(&sharing_contract))))
sharing_contract->Present(d3d12_res, 0, WindowFromDC((HDC)winsys_drawable_handle));
#endif
winsys->displaytarget_display(winsys, res->dt, winsys_drawable_handle, sub_box);
}