aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorGurchetan Singh <gurchetansingh@chromium.org>2022-08-26 11:10:12 -0700
committerJoshua Duong <joshuaduong@google.com>2022-09-13 07:28:50 -0700
commitd1641bdffeea01e510dbb85fc5669825340fa198 (patch)
treefadbe237f60607764ea9c8b1167dbe0616034724 /base
parent52e4349fd926e3c4e8bf075a6faf36c85911edd4 (diff)
downloadaemu-d1641bdffeea01e510dbb85fc5669825340fa198.tar.gz
vulkan-cereal: external Vulkan memory for gfxstream + vhost-user
This adds initial external memory support for gfxstream, so when Cuttlefish and friends transition to vhost-user, the virtio-gpu device will relatively ready. There are a few other things to do: Namely: - Cross platform abstrations rather than #ifdef everywhere - Windows support - Should we use UUIDs instead of physical device index? - Should we nuke memory_index and rely on vkGetMemoryFdPropertiesKHR instead? - Passing in VkExternalMemoryBufferCreateInfo or VkExternalMemoryImageCreateInfo if the validation layers complains about it's absence BUG=235485545 TEST=compile and run Change-Id: I9858892fdfe16a785d990ce44cd09b68815c80cf
Diffstat (limited to 'base')
-rw-r--r--base/include/base/ManagedDescriptor.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/include/base/ManagedDescriptor.hpp b/base/include/base/ManagedDescriptor.hpp
index db43188..0dfb406 100644
--- a/base/include/base/ManagedDescriptor.hpp
+++ b/base/include/base/ManagedDescriptor.hpp
@@ -37,6 +37,10 @@ struct PlatformTraitUnixLike {
#endif
} // namespace internal
+
+template <class PlatformTrait>
+using DescriptorTypeBase = typename PlatformTrait::DescriptorType;
+
// An RAII wrapper for fd on *nix or HANDLE on Windows. The interfaces are similar to std::unique.
template <class PlatformTrait>
class ManagedDescriptorBase {
@@ -94,8 +98,10 @@ class ManagedDescriptorBase {
};
#ifdef _WIN32
+using DescriptorType = DescriptorTypeBase<internal::PlatformTraitWin32>;
using ManagedDescriptor = ManagedDescriptorBase<internal::PlatformTraitWin32>;
#elif defined(__APPLE__) || defined(__linux__)
+using DescriptorType = DescriptorTypeBase<internal::PlatformTraitUnixLike>;
using ManagedDescriptor = ManagedDescriptorBase<internal::PlatformTraitUnixLike>;
#endif