vulkan_enc: Add vkGetLinearImageLayoutGOOGLE() method to guest encoder.
This add support to vkGetLinearImageLayoutGOOGLE() method to guest.
For details see host-side change:
https://android-review.googlesource.com/c/platform/external/qemu/+/1426693
Change-Id: I60ebbc3195d34cc4278d7155494efbda4f35fe37
diff --git a/system/vulkan/func_table.cpp b/system/vulkan/func_table.cpp
index 51913e8..6a4a128 100644
--- a/system/vulkan/func_table.cpp
+++ b/system/vulkan/func_table.cpp
@@ -5338,6 +5338,33 @@
vkEnc->vkQueueBindSparseAsyncGOOGLE(queue, bindInfoCount, pBindInfo, fence);
}
#endif
+#ifdef VK_GOOGLE_linear_image_layout
+static void entry_vkGetLinearImageLayoutGOOGLE(
+ VkDevice device,
+ VkFormat format,
+ VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment)
+{
+ AEMU_SCOPED_TRACE("vkGetLinearImageLayoutGOOGLE");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetLinearImageLayoutGOOGLE(device, format, pOffset, pRowPitchAlignment);
+}
+static void dynCheck_entry_vkGetLinearImageLayoutGOOGLE(
+ VkDevice device,
+ VkFormat format,
+ VkDeviceSize* pOffset,
+ VkDeviceSize* pRowPitchAlignment)
+{
+ auto resources = ResourceTracker::get();
+ if (!resources->hasDeviceExtension(device, "VK_GOOGLE_linear_image_layout"))
+ {
+ sOnInvalidDynamicallyCheckedCall("vkGetLinearImageLayoutGOOGLE", "VK_GOOGLE_linear_image_layout");
+ }
+ AEMU_SCOPED_TRACE("vkGetLinearImageLayoutGOOGLE");
+ auto vkEnc = HostConnection::get()->vkEncoder();
+ vkEnc->vkGetLinearImageLayoutGOOGLE(device, format, pOffset, pRowPitchAlignment);
+}
+#endif
void* goldfish_vulkan_get_proc_address(const char* name){
#ifdef VK_VERSION_1_0
if (!strcmp(name, "vkCreateInstance"))
@@ -6813,6 +6840,12 @@
return nullptr;
}
#endif
+#ifdef VK_GOOGLE_linear_image_layout
+ if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE"))
+ {
+ return nullptr;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_instance_proc_address(VkInstance instance, const char* name){
@@ -8389,6 +8422,12 @@
return hasExt ? (void*)entry_vkQueueBindSparseAsyncGOOGLE : nullptr;
}
#endif
+#ifdef VK_GOOGLE_linear_image_layout
+ if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE"))
+ {
+ return (void*)dynCheck_entry_vkGetLinearImageLayoutGOOGLE;
+ }
+#endif
return nullptr;
}
void* goldfish_vulkan_get_device_proc_address(VkDevice device, const char* name){
@@ -10036,6 +10075,13 @@
return hasExt ? (void*)entry_vkQueueBindSparseAsyncGOOGLE : nullptr;
}
#endif
+#ifdef VK_GOOGLE_linear_image_layout
+ if (!strcmp(name, "vkGetLinearImageLayoutGOOGLE"))
+ {
+ bool hasExt = resources->hasDeviceExtension(device, "VK_GOOGLE_linear_image_layout");
+ return hasExt ? (void*)entry_vkGetLinearImageLayoutGOOGLE : nullptr;
+ }
+#endif
return nullptr;
}