d3d11memory: Allow CreateSharedHandle() without keyed mutex

For d3d11 resource to be shared with d3d12, keyed mutex shouldn't
be enabled since d3d12 resource does not expose the keyed mutex
interface

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5356>
This commit is contained in:
Seungha Yang 2023-09-20 01:13:15 +09:00 committed by GStreamer Marge Bot
parent bb040ce571
commit 2aa88033b2

View file

@ -1416,8 +1416,6 @@ gboolean
gst_d3d11_memory_get_nt_handle (GstD3D11Memory * mem, HANDLE * handle)
{
GstD3D11MemoryPrivate *priv;
const guint misc_flags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX |
D3D11_RESOURCE_MISC_SHARED_NTHANDLE;
ComPtr < IDXGIResource1 > resource;
HRESULT hr;
@ -1437,8 +1435,10 @@ gst_d3d11_memory_get_nt_handle (GstD3D11Memory * mem, HANDLE * handle)
return TRUE;
}
if ((priv->desc.MiscFlags & misc_flags) != misc_flags)
if ((priv->desc.MiscFlags & D3D11_RESOURCE_MISC_SHARED_NTHANDLE) !=
D3D11_RESOURCE_MISC_SHARED_NTHANDLE) {
return FALSE;
}
hr = priv->texture->QueryInterface (IID_PPV_ARGS (&resource));
if (!gst_d3d11_result (hr, mem->device))