[d3d9] Fix shared handle check for exporting images

Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Derek Lesho 2022-03-12 21:25:31 +01:00 committed by Philip Rebohle
parent c87660480d
commit 1d1d8adee6
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 6 additions and 5 deletions

View File

@ -241,13 +241,14 @@ namespace dxvk {
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.layout = VK_IMAGE_LAYOUT_GENERAL;
imageInfo.shared = m_desc.IsBackBuffer;
if (pSharedHandle) {
imageInfo.sharing.type = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
if (*pSharedHandle) {
imageInfo.shared = true;
imageInfo.sharing.mode = *pSharedHandle == INVALID_HANDLE_VALUE ? DxvkSharedHandleMode::Export : DxvkSharedHandleMode::Import;
imageInfo.sharing.handle = *pSharedHandle;
}
imageInfo.sharing.mode = (*pSharedHandle == INVALID_HANDLE_VALUE || *pSharedHandle == nullptr)
? DxvkSharedHandleMode::Export
: DxvkSharedHandleMode::Import;
imageInfo.sharing.type = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT;
imageInfo.sharing.handle = *pSharedHandle;
// TODO: validate metadata?
}