dzn: Ignore export access parameters
authorJesse Natalie <jenatali@microsoft.com>
Wed, 21 Jun 2023 15:39:02 +0000 (08:39 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Jun 2023 18:31:28 +0000 (18:31 +0000)
D3D requires these to just be GENERIC_ALL. Fixes some sharing tests.

Fixes: c64f1b66 ("dzn: Hook up win32 semaphore import/export")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23772>

src/microsoft/vulkan/dzn_device.c
src/microsoft/vulkan/dzn_sync.c

index 16d9467..c7064d4 100644 (file)
@@ -2963,13 +2963,12 @@ dzn_device_memory_create(struct dzn_device *device,
    if (export_flags) {
       error = VK_ERROR_INVALID_EXTERNAL_HANDLE;
       ID3D12DeviceChild *shareable = mem->heap ? (void *)mem->heap : (void *)mem->dedicated_res;
+      DWORD dwAccess = GENERIC_ALL; /* Ignore any provided access, this is the only one D3D allows */
 #ifdef _WIN32
       const SECURITY_ATTRIBUTES *pAttributes = win32_export ? win32_export->pAttributes : NULL;
-      DWORD dwAccess = win32_export ? win32_export->dwAccess : GENERIC_ALL;
       const wchar_t *name = win32_export ? win32_export->name : NULL;
 #else
       const SECURITY_ATTRIBUTES *pAttributes = NULL;
-      DWORD dwAccess = GENERIC_ALL;
       const wchar_t *name = NULL;
 #endif
       if (FAILED(ID3D12Device_CreateSharedHandle(device->dev, shareable, pAttributes,
index 76e047c..0736401 100644 (file)
@@ -274,7 +274,7 @@ dzn_sync_prep_win32_export(struct vk_device *device, struct vk_sync *sync,
    struct dzn_device *ddev = container_of(device, struct dzn_device, vk);
    if (FAILED(ID3D12Device_CreateSharedHandle(ddev->dev, (ID3D12DeviceChild *)dsync->fence,
                                               (const LPSECURITY_ATTRIBUTES)security_attributes,
-                                              access, name, &dsync->export_handle)))
+                                              GENERIC_ALL, name, &dsync->export_handle)))
       return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY);
    return VK_SUCCESS;
 }