MoltenVK enforces that a single VkImage can be dedicated to a memory
binding. When this code runs it breaks that promise and results in an error
return when `vkBindImageMemory` is called by the client.
Just like QNX, macOS does not natively support DMA buffers.
Also indicate that VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME is
emulated in `vkEnumerateDeviceExtensionProperties`.
On macOS MoltenVK can be installed as part of Vulkan SDK or as standalone.
If standalone, VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME will not be
supported. Therefore, we decouple the detection of portability enumeration
from detection of MoltenVK.
Currently, we save all the vkUpdateDescriptorSets commands
and replay then during loading.
This leads to very large amount of commands and it is
slowing down both the saving and loading, when the emulator
has run a longer period of time.
Prior work worked around this problem by saving only the
active descriptors, but it only works with VulkanBatchedDescriptorSetUpdate
feature.
This cl improves prior work to make it work without
VulkanBatchedDescriptorSetUpdate feature.
Bug: 417788798
Change-Id: I5b83566db3723135b9d8dd2df56ad1d7f2a751ed
Android Hardware Buffers can be created with mip levels and
the mismatch is causing errors when importing vulkan images.
Bug: 406456167
Test: CtsNativeHardwareTestCases
Change-Id: I3634bd400574453bf4ff123c149cb5f95409a42f
Creation of conversion objects with undefined formats causes driver
crashes on Intel GPUs later on descriptor set layout creation. Failing
early enables booting XR emulator correctly.
Bug: 439619234
Test: run XR emulator on intel GPU
Change-Id: I9d79a0d9bcb6dc7ec1aedf4320547ef93b5604ab
Reduce usages of stderr printing and use gfxstream logging
functions instead.
Bug: 389637419
Bug: 433496880
Test: CI
Change-Id: I52ad2fe9953cffa1b028b9a388e7f90c7141a9c0
... to allow sharing perfetto global flow ids between guest and host
so that combined traces can have an arrow between the guest and host
render threads to aid debugging.
Bug: b/440065361
Test: Capture guest and host trace and inspect in perfetto UI
Change-Id: Id1c34dbee40c8febc9730479d1daed37722fcd09
The semaphore's signal state should be tracked and saved,
and later re-signaled if necessary during load, so that
any subsequent wait on the same semaphore could go ahead
instead of hanging.
Bug: 417788798
Change-Id: I15bd28be70e0582f049fd6cd281290fb37a5d694
for udmabuf case, it's not virtgpuMapped, but still requires
emulation for coherent memory
Bug: 424729656
Bug: 423003849
Test: check if there is no broken image
Change-Id: I68554700ab086c27a25f4809623273c70ab692c6
There is currently a problem of missed setevent
and that leads to wait event hangs, or queue becomes
not able to idle, no matter how long it is waited upon.
To solve this problem, this cl follows each event's set,
reset, and save the set status into snapshot.
Later one, during loading, it recovers their set status,
so that subsequent cmd event wait can continue.
specifically, the following steps are taken:
1, set and reset operations from host or
in the queue are tracked.
2, if an event is set, that status will be saved
into snapshot; later during loadiing, the set operation
will be set again from the host or in the same queue
before snapshot.
This is not complete, but it is a first step
to resolve some of the timeout issue.
TODO:
event2
Test: xr should not hang during save due to
queue gets blocked (vkQueueSubmit does not return,
or wait for fence times out)
Bug: 417788798
Change-Id: I991cccfb2f34c6189f6c0759b8abbb365b695719
Also adjust some of the logs related to the device/instance
info tracking.
Bug: 406456167
Test: dEQP-VK.api.device_init.*
Change-Id: I4cbaf9194a85bce1dd88f7d1ae58cb6912d33cb9
* No udmabuf-like mechanism exists on Windows.
* isImport --> importEmulationExternalMemory. Host visible
memory may be emulated via vkImportMemory{Fd, HANDLE}, but
it's not need for shareable blobs (gralloc buffers) in many
cases. Even if the shareable blob is host visible.
* uniqueShmemId --> sUniqueShmemId
The allocation logic is very delicate. A good target for further
refactors.
BUG=423003060
TEST=CI
... as otherwise the `VkFence` saved in `DeviceOpTracker` may
become invalid before the `vkGetFenceStatus()` occurs.
Test:
```
bazel test common/end2end:gfxstream_end2end_tests \
--graphics_drivers=gles_angle_vulkan_swiftshader \
--test_arg="--gtest_filter=*MultiThreadedResetCommandBuffer*:-*MultiThreadedResetCommandBuffer*VulkanSnapshots*" \
--test_arg="--gtest_repeat=100" \
--test_output=streamed
```
... as VkSnapshotApiCallInfo* is a pointer into a
std::vector<VkSnapshotApiCallInfo> which can be invalidated during
multi threaded VK usage when the std::vector<> is resized.
Bug: b/422483825
Test: bazel test common/end2end:gfxstream_end2end_tests \
--graphics_drivers=gles_angle_vulkan_swiftshader \
--test_arg="--gtest_filter=*MultiThreadedResetCommandBuffer*VulkanSnapshots*" \
--test_arg="--gtest_repeat=100" \
--test_output=streamed
Change-Id: I8ea16eea8792b11056d6d7f17e370f9aa045406c
Avoid calling needEmulatedDecompression from various locations
by holding the compression information inside ImageInfo as a
pointer, which will be valid only when compression is emulated.
This optimizes the memory footprint of image information for
non compressed textures and simplifies various checks by
moving global emulation related flag checks to only image
creation time.
Bug: 389637419
Bug: 420961757
Test: dEQP-GLES31.functional.copy_image.compressed.*
Change-Id: I91288c9d91c7fc9a8ba72d9134c1d23a10f93931
Handing over the texture compression work to ANGLE on guest is
causing some GLES31 test failures and does not look helpful.
Always use host side decompression to reduce divergence.
Bug: 420961757
Bug: 406456167
Test: dEQP-GLES31.functional.copy_image.compressed.*
Test: dEQP-GLES31.functional.copy_image.mixed.*
Change-Id: Iabd27ffa5c320716afefcde3f8d921626ad2ba57
Move engine and application names inside quotation marks
to make them clear, when the names contain spaces.
Bug: 389637419
Test: CI
Change-Id: Ie73a191d391e7be880ca4a8cc5814a3f5c540a78
When using virtual graphics queue, wait-before-signal behavior is
controlled manually on the host to avoid deadlock situations on a single
physical backing queue. Initial implementation was only handling
vkQueueSubmit2 calls.
This CL implements some of the missing parts for the existing feature,
for old style sync routines and structures, by correctly handling the
VkTimelineSemaphoreSubmitInfo data attached to the submissions and
optimizes the copying of submission info structures. Also enables
timeline semaphore feature support on the physical device back.
Bug: 379862480
Bug: 406456167
Bug: 383570894
Test: dEQP-VK.info#device_mandatory_features
Test: dEQP-VK.synchronization.timeline_semaphore.wait_before_signal.*
Change-Id: Ieb3ac75ac45c6ec45df36d0f866f5439e900adbd
Follow-up to aosp/3560867.
The current exportMemoryHandle(..) doesn't use the correct Vk
device. This leads to failures in the export flow.
BUG=406513306
TEST=X11 apps work again
Change-Id: I83ab73a0334481f3226853f4d822267d88db1c71
The wait_before_signal tests are not stable enough.
Bug: 398986781
Test: dEQP-VK.synchronization.timeline_semaphore.wait_before_signal.*
Change-Id: Icb5490b5372394ad8dd91b9bf0069db9bdb2b48a
Use object information directly to get instance
and physical device mappings instead.
Removes mDeviceToPhysicalDevice and mPhysicalDeviceToInstance
Bug: 389637419
Test: CI
Change-Id: I09ce14dd1f0e04eedc00b2b14c70728c73873cac
And do not return an error code for the submission
as this should only cause some composition issues
where the error message would be very visible due
to 5 seconds wait.
Bug: 389637419
Bug: 406456167
Test: run dEQP with lavapipe, debugger attached
Change-Id: I6696a0561bbb4021baeb78b3d1e373d7d51cb846