~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/vulkan/runtime/vk_sync.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
400
400
   assert(!(sync->flags & VK_SYNC_IS_TIMELINE));
401
401
   return sync->type->export_sync_file(device, sync, sync_file);
402
402
}
 
403
 
 
404
VkResult
 
405
vk_sync_import_win32_handle(struct vk_device *device,
 
406
                            struct vk_sync *sync,
 
407
                            void *handle,
 
408
                            const wchar_t *name)
 
409
{
 
410
   VkResult result = sync->type->import_win32_handle(device, sync, handle, name);
 
411
   if (unlikely(result != VK_SUCCESS))
 
412
      return result;
 
413
 
 
414
   sync->flags |= VK_SYNC_IS_SHAREABLE |
 
415
                  VK_SYNC_IS_SHARED;
 
416
 
 
417
   return VK_SUCCESS;
 
418
}
 
419
 
 
420
VkResult
 
421
vk_sync_export_win32_handle(struct vk_device *device,
 
422
                            struct vk_sync *sync,
 
423
                            void **handle)
 
424
{
 
425
   assert(sync->flags & VK_SYNC_IS_SHAREABLE);
 
426
 
 
427
   VkResult result = sync->type->export_win32_handle(device, sync, handle);
 
428
   if (unlikely(result != VK_SUCCESS))
 
429
      return result;
 
430
 
 
431
   sync->flags |= VK_SYNC_IS_SHARED;
 
432
 
 
433
   return VK_SUCCESS;
 
434
}
 
435
 
 
436
VkResult
 
437
vk_sync_set_win32_export_params(struct vk_device *device,
 
438
                                struct vk_sync *sync,
 
439
                                const void *security_attributes,
 
440
                                uint32_t access,
 
441
                                const wchar_t *name)
 
442
{
 
443
   assert(sync->flags & VK_SYNC_IS_SHARED);
 
444
 
 
445
   return sync->type->set_win32_export_params(device, sync, security_attributes, access, name);
 
446
}