dawn-cmake/src/dawn_native/vulkan/ExternalHandle.h
David 'Digit' Turner fa00c69506 [fuchsia] Implement external semaphore and memory support.
This CL adds Fuchsia-specific implementations to the following
classes:

  dawn_native::vulkan::external_memory::Service
  dawn_native::vulkan::external_semaphore::Service

The implementation is based on two Fuchsia Vulkan extensions
that are provides by the vulkan_fuchsia_extras.h header (i.e.
are not upstreamed to Khronos yet, but used/provided by the
Fuchsia platform):

  VK_FUCHSIA_external_memory
  VK_FUCHSIA_external_semaphore

Their details are similar to VK_KHR_external_XXXX_fd, but
uses Zircon handles instead of file decriptors.

BUG=dawn:221
Change-Id: I48238bcf3193433970cbe200a84b86a67103a2f2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10963
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: David Turner <digit@google.com>
2019-09-10 10:07:28 +00:00

27 lines
781 B
C++

#ifndef DAWNNATIVE_VULKAN_EXTERNALHANDLE_H_
#define DAWNNATIVE_VULKAN_EXTERNALHANDLE_H_
#include "common/vulkan_platform.h"
namespace dawn_native { namespace vulkan {
#if DAWN_PLATFORM_LINUX
// File descriptor
using ExternalMemoryHandle = int;
// File descriptor
using ExternalSemaphoreHandle = int;
#elif DAWN_PLATFORM_FUCHSIA
// Really a Zircon vmo handle.
using ExternalMemoryHandle = zx_handle_t;
// Really a Zircon event handle.
using ExternalSemaphoreHandle = zx_handle_t;
#else
// Generic types so that the Null service can compile, not used for real handles
using ExternalMemoryHandle = void*;
using ExternalSemaphoreHandle = void*;
#endif
}} // namespace dawn_native::vulkan
#endif // DAWNNATIVE_VULKAN_EXTERNALHANDLE_H_