virtio-gpu: hostmem
bug: 146066070
Change-Id: I1c06293804e800694f355716f608b76e9bfdb428
diff --git a/system/vulkan/func_table.cpp b/system/vulkan/func_table.cpp
index c9dd80d..80f586f 100644
--- a/system/vulkan/func_table.cpp
+++ b/system/vulkan/func_table.cpp
@@ -5216,6 +5216,39 @@
return vkCreateBufferWithRequirementsGOOGLE_VkResult_return;
}
#endif
+#ifdef VK_GOOGLE_address_space_info
+static VkResult entry_vkGetMemoryHostAddressInfoGOOGLE(
+ VkDevice device,
+ VkDeviceMemory memory,
+ uint64_t* pAddress,
+ uint64_t* pSize,
+ uint64_t* pHostmemId)
+{
+ AEMU_SCOPED_TRACE("vkGetMemoryHostAddressInfoGOOGLE");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0;
+ vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = vkEnc->vkGetMemoryHostAddressInfoGOOGLE(device, memory, pAddress, pSize, pHostmemId);
+ return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return;
+}
+static VkResult dynCheck_entry_vkGetMemoryHostAddressInfoGOOGLE(
+ VkDevice device,
+ VkDeviceMemory memory,
+ uint64_t* pAddress,
+ uint64_t* pSize,
+ uint64_t* pHostmemId)
+{
+ auto resources = ResourceTracker::get();
+ if (!resources->hasDeviceExtension(device, "VK_GOOGLE_address_space_info"))
+ {
+ sOnInvalidDynamicallyCheckedCall("vkGetMemoryHostAddressInfoGOOGLE", "VK_GOOGLE_address_space_info");
+ }
+ AEMU_SCOPED_TRACE("vkGetMemoryHostAddressInfoGOOGLE");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0;
+ vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = vkEnc->vkGetMemoryHostAddressInfoGOOGLE(device, memory, pAddress, pSize, pHostmemId);
+ return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return;
+}
+#endif
void* goldfish_vulkan_get_proc_address(const char* name){
#ifdef VK_VERSION_1_0
if (!strcmp(name, "vkCreateInstance"))
@@ -6661,6 +6694,12 @@
return nullptr;
}
#endif
+#ifdef VK_GOOGLE_address_space_info
+ if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE"))
+ {
+ return nullptr;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name){
@@ -8203,6 +8242,12 @@
return (void*)dynCheck_entry_vkCreateBufferWithRequirementsGOOGLE;
}
#endif
+#ifdef VK_GOOGLE_address_space_info
+ if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE"))
+ {
+ return (void*)dynCheck_entry_vkGetMemoryHostAddressInfoGOOGLE;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name){
@@ -9814,6 +9859,13 @@
return hasExt ? (void*)entry_vkCreateBufferWithRequirementsGOOGLE : nullptr;
}
#endif
+#ifdef VK_GOOGLE_address_space_info
+ if (!strcmp(name, "vkGetMemoryHostAddressInfoGOOGLE"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_address_space_info");
+ return hasExt ? (void*)entry_vkGetMemoryHostAddressInfoGOOGLE : nullptr;
+ }
+#endif
return nullptr;
}