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
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
And
VK_FORMAT_R32_SFLOAT
VK_FORMAT_R5G6B5_UNORM_PACK16
some unity games seem to use such formats
Bug: 418814845
Change-Id: Id0eec8cd0e920cfc60a2b3575b1e3640c502d5ac
If the format is not recognizable, it is ok to skip it;
so that the subsequent saving and loading can continue.
Bug: 417788798
Change-Id: Iac3281db82ae3b261ed6b9286841cae5a4012979
and add Android support which uses __android_log_print to
the default callback. This will allow us to eventually build
and run the guest libs in a standalone bazel environment without
Android libs (no "liblog", "libcutils", etc).
Misc notes:
* Updates some cases of ANDROID vs __ANDROID__. The former is
set when building with Soong (either host or guest) while the
latter is set specifically when targeting the Android platform.
Some places that were using ANDROID needed to be fixed to use
__ANDROID__ to properly detect when to use ANativeWindow.
* Updates the EGL platform header to address something similar
to the above where we may want to use X11 display when building
host binaries with Soong where ANDROID may still be defined.
Bug: b/416342919
Test: cd hardware/google/gfxstream
bazel build ...
bazel test ...
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu main dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: I4db669047f3900392d50509c470ea350d94a64ba
Moves several of the "common/base" classes to host/backend as these
classes all used `Stream` which is a host only interface.
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu main dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: Ia664776c2322b310614f632e4926bb3b031f3bc1
NO_IFTTT=existing field covered with type change
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu master dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Change-Id: I6bfb2c4ef8368799d9f99f6293d9762b7dcb4c7f
We did a few things here.
1. Update VkBindImageMemoryInfo in vkBindImageMemory2 for snapshot. In
its implementation, vkBindImageMemory2 sometimes replaces an unboxed
VkImage handle with a new one, which breaks snapshot. We update its
value so that it can map to the proper one when calling snapshot
functions. Note that there is a const cast which we might want to fix
later.
2. Lock it properly when calling createExtraHandlesForNextApi.
3. Add support for more VkImage format. Fix mipmap extend calculation.
Now it works with -guest-angle but fails with VVL, not sure why.
Bug: 346415931
Test: manual
Change-Id: I0b3153bede12ea95e7462ddaa411d6e2fed6410b
It seems that adding transfer src/dst usages to uniform buffers will
make Chrome less stable. Remove them and rely on memory snapshot to
snapshot buffer contents.
Bug: 342414479
Test: GfxstreamEnd2EndVkSnapshotPipelineTest
Change-Id: Ie9572a7e8f015378f89f106ec628647836513d8e
Record all vkCmd* commands. Also clear them on vkResetCommandBuffer.
Also use VK_IMAGE_ASPECT_STENCIL_BIT when snapshotting stencil
images.
Bug: 330763497
Test: CanSnapshotCommandBuffer
Change-Id: I71e1d80e59cb3321f3bb120f520e633aedf182d9
This commmit snapshots vulkan descriptor sets. Please refer to
go/aemu-vulkan-snapshot-testing for detailed design.
For descriptors, API playback does not work because it does not provide
enough granularity. To address this issue, we shadow the states of
descriptors and rebuild a descriptor update command on snapshot load.
Currently it only works with VulkanBatchedDescriptorSetUpdate.
Bug: 332770507
Test: CanSnapshotDescriptors
Change-Id: I01bd51cd03072da9357eba2404d408e6995ffc7a
We have a situation that the color buffer vulkan images are transformed
into the wrong layout after snapshot load. Fix it by memorizing the
layout in snapshot.
We don't have a test for it yet as we don't really understand how to
trigger this behavior at unittest level.
Also recover layout for multi-sample images after snapshot loads. But we
still don't snapshot its content yet.
Bug: 332775761
Test: CanSubmitQueue
Change-Id: I8007f504d055041b11c3af3425cfbdbfac0553dd
Adds a phyiscal device memory helper for organizing all of the
various physical memory changes and moves some of the existing
changes into the helper to avoid duplication.
Adds some tests for some of the existing physical memory changes.
Bug: b/283005889
Test: gfxstream_vkemulatedphysicaldevicememory_tests
Test: cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader
cts -m CtsNativeHardwareTestCases
Test: GfxstreamEnd2EndTests
Test: GfxstreamEnd2EndTests on SwiftShader
Change-Id: Ieb45fad253df27e483b8a04444bd3abb5c87d1ab
We are trying to make vk snapshot load the google Chrome home page
without crashing. With this CL it does not crash during load but would
crash with a device lost after submitting a queue (which is
unsurprising because everything is missing to snapshot vk queue).
Content of this commit includes:
- Add dependencies for VkImageView, VkGraphicsPipelines, VkFramebuffer.
They are necessary to tell the snapshot module the order of vk object
creation.
- Add vkBindImageMemory into the loading sequencey of VkImage, so that
it would be executed before vkCreateImageView.
- Delay the destruction of VkShaderModule. This is because other
objects can still refer to it after it is destroyed.
- Initialize VK backend for color buffer properly on snapshot load.
- Save and load vk images in the same order by sorting them according
to their boxed handle.
- Record all the placeholder handles for vkCreateDescriptorPool. For
performance purpose this function creates a lot of extra handles
without real contents. We need to snapshot those handles as well.
Bug: 329506242
Test: GfxstreamEnd2EndVkSnapshotImageTest, GfxstreamEnd2EndVkSnapshotPipelineTest
Change-Id: I999c3477f861cec51ae743f11c3031be438b3ddf
This commit snapshots vk image content by allocating a staging buffer
and copying the bytes on snapshot. It only works in the simplest setup.
Many situations are not considered in this commit, they include:
(1) the image does not support VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
layout;
(2) the image does not support VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
layout;
(3) the queue is dirty.
Also there is no performance optimization.
Implementation-wise, snapshot happens in VkDecoderGlobalState after
recording / playing back all create / bind commands. It borrows an
existing queue to run the extra vk copy commands. A temporary staging
buffer is also created for copying. Later we could optimize the code
by reusing most of the temporary objects.
Bug: 294277842
Test: GfxstreamEnd2EndVkSnapshotImageTest.ImageContent
Change-Id: I44e58c2a4edabc7ea56f97ba8789c9e43e3baa68