vulkan: Support imported host-visible memory on Fuchsia.
This change adds required logic to support GOLDFISH_HOST_VISIBLE
heap and host-visible external memory allocation on Fuchsia.
It includes the following parts:
(1) BufferCollectionConstraints:
Now both DEVICE_LOCAL and HOST_VISIBLE domain can be added to
the buffer_constraints.
Currently, the domain of buffer collection constraints set in
"setBufferCollectionConstraints(collection, image_create_info)"
suppots both Heap types; other sysmem participants need to specify
buffer memory constraints (cpu_supported, ram_supported,
inaccessible_supported) or directly specify HeapType to choose
the actual Heap.
(2) Stride:
The stride of the Image will be determined by host GPU using
vkGetLinearImageLayoutGOOGLE() method; other sysmem participants
should NOT specify stride / offset requirements.
(3) Usage:
Currently the VMO and VMAR rights is completely determined by the
VkImage usage. It is writeable only when the usages in their
ImageCreateInfo contains some writeable types (e.g. TRANSFER_DST).
TEST=terminal and spinning-square-rs on FEMU (software-gpu).
Both apps uses host rendering and allocates image buffers from sysmem
host-visible Heap.
Bug: fuchsia:54153
Change-Id: I8268b5fbe6d8a547bde2b02537130530849831f7
1 file changed