[vulkan] Allow custom logic in guest to access encoder/resourcetracker
bug: 120118806
+ do not alloc in guest if memory is not host visible.
+ extend host-visible allocs to be multiple of nonCoherentAtomSize if
necessary.
Change-Id: I4030d3f120627a18c7bc62da31e6db46a0544d9b
diff --git a/system/vulkan_enc/ResourceTracker.h b/system/vulkan_enc/ResourceTracker.h
index ed061f3..07dd421 100644
--- a/system/vulkan_enc/ResourceTracker.h
+++ b/system/vulkan_enc/ResourceTracker.h
@@ -17,6 +17,7 @@
#include <vulkan/vulkan.h>
#include "VulkanHandleMapping.h"
+#include "VulkanHandles.h"
#include <memory>
namespace goldfish_vk {
@@ -30,7 +31,18 @@
VulkanHandleMapping* unwrapMapping();
VulkanHandleMapping* destroyMapping();
VulkanHandleMapping* defaultMapping();
-private:
+
+#define HANDLE_REGISTER_DECL(type) \
+ void register_##type(type); \
+ void unregister_##type(type); \
+
+ GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_DECL)
+
+ void setDeviceInfo(VkDevice device, VkPhysicalDevice physdev, VkPhysicalDeviceProperties props, VkPhysicalDeviceMemoryProperties memProps);
+ bool isMemoryTypeHostVisible(VkDevice device, uint32_t typeIndex) const;
+ VkDeviceSize getNonCoherentExtendedSize(VkDevice device, VkDeviceSize basicSize) const;
+
+ private:
class Impl;
std::unique_ptr<Impl> mImpl;
};