frontbuffer enhancements to ANDROID_vulkan_native_buffer
Since VK_KHR_swapchain is implemented entirely in libvulkan, we need an
image-level mechanism to inform the driver that a swapchain image will
be used for front-buffered rendering. This is implemented by chaining
another structure off of the VkImageCreateInfo passed to the driver when
creating swapchain images.
V2: Don't foul up api file. Rerun code generators.
V3: Rename VkNativeBuffer2ANDROID structure to
VkSwapchainImageCreateInfoANDROID
V4: Provide nulldrv stub for new function
V5: rebase.
Change-Id: I4447400cb1782440638e4c8816b081dd8923ddb9
Test: compile
diff --git a/vulkan/nulldrv/null_driver.cpp b/vulkan/nulldrv/null_driver.cpp
index 05ebcac..c403ede 100644
--- a/vulkan/nulldrv/null_driver.cpp
+++ b/vulkan/nulldrv/null_driver.cpp
@@ -886,6 +886,16 @@
return VK_SUCCESS;
}
+VkResult GetSwapchainGrallocUsage2ANDROID(VkDevice,
+ VkFormat,
+ VkImageUsageFlags,
+ VkSwapchainImageUsageFlagsANDROID,
+ int* grallocUsage) {
+ // The null driver never reads or writes the gralloc buffer
+ *grallocUsage = 0;
+ return VK_SUCCESS;
+}
+
VkResult AcquireImageANDROID(VkDevice,
VkImage,
int fence,