[flutter_runner] use external image create info

DX-939 #progress
MA-394 #progress

This informs the vulkan driver that we're creating an image
that will be backed by external memory. The driver driver can
decide to use different memory requirements based on the if
memory for the image can be exported or not.

No change in behavior. Existing tests (modular_tests,
scenic_tests, etc.) are sufficient and regressions will be
prevented by running these tests on aemu.

Test: fx shell run fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx --base_shell=fuchsia-pkg://fuchsia.com/spinning_cube#
Change-Id: I489318c2e31f752f76c80a81245e203861d44d94

Ported from Topaz tree.
This commit is contained in:
Chris Bracken
2019-06-28 15:37:40 -07:00
parent 03d65cc0c5
commit e369245671
2 changed files with 7 additions and 1 deletions

View File

@@ -36,9 +36,14 @@ bool CreateVulkanImage(vulkan::VulkanProvider& vulkan_provider,
// garnet/public/lib/escher/util/image_utils.cc) or else the different vulkan
// devices may interpret the bytes differently.
// TODO(SCN-1369): Use API to coordinate this with scenic.
out_vulkan_image->vk_external_image_create_info = {
.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
.pNext = nullptr,
.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_TEMP_ZIRCON_VMO_BIT_FUCHSIA,
};
out_vulkan_image->vk_image_create_info = {
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
.pNext = nullptr,
.pNext = &out_vulkan_image->vk_external_image_create_info,
.flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT,
.imageType = VK_IMAGE_TYPE_2D,
.format = VK_FORMAT_B8G8R8A8_UNORM,

View File

@@ -29,6 +29,7 @@ struct VulkanImage {
VulkanImage(VulkanImage&&) = default;
VulkanImage& operator=(VulkanImage&&) = default;
VkExternalMemoryImageCreateInfo vk_external_image_create_info;
VkImageCreateInfo vk_image_create_info;
VkMemoryRequirements vk_memory_requirements;
vulkan::VulkanHandle<VkImage> vk_image;