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
... 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
Improve readability of the code by removing some of the
unnecessary parentheses in the generated code.
(regen auto generated code)
Bug: 329094533
Test: CI
Change-Id: I8c29b49cb58310c70820421e1fd3abea8bd00a92
When `VkFramebufferCreateInfo::flags` has
`VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT`,
`VkFramebufferCreateInfo::pAttachments` should be ignored.
Bug: b/424862032
Test: cvd create \
--gpu_mode=gfxstream_guest_angle_host_swiftshader \
--gpu_renderer_features="VulkanSnapshots:enabled"
Change-Id: Icb5641ee31a1d155a92931c1b91777cfc54ffeca
... 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
vkUpdateDescriptorSetWithTemplateSizedGOOGLE and
vkUpdateDescriptorSetWithTemplateSized2GOOGLE
They both are treated similar to vkUpdateDescriptorSets.
Bug: 418814845
Change-Id: Idcb5639e88e7dd148d089af3c960a3beb4a7deb7
When this fails, there is no vulkan handle created, but the snapshot
saves it anyway, leading to subsequent load failures, as the saved
invalid handle (0x0) shifted the handle order.
Bug: 417788798
Change-Id: I1c19ab67dc23e01d43cccc6dae5c28d52870da23
.. after recent changes on the build script due to xml file
location change.
Bug: 417150515
Test: CI
Change-Id: I04b2e40778fc8f2c832a4c9204a411fe9895dd08
Includes a small change to keep using MTLResource_id
which actually didn't make it into the spec.
A typo fix in vulkansc_raii.hpp
Fixes on end2end tests for vulkanhpp changes.
Change to enable comparison operators on handles even when
the spaceship operator is available, to avoid errors on
old compilers where they are not generated.
Bug: 417150515
Test: CI
Test: dEQP-VK.api.info.vulkan1p2
Test: atest GfxstreamEnd2EndTests
Change-Id: Ic9b9256541dde50b77c4d6d63d277bc222a64157
When this is called, the command buffers allocated
from this command pool should all reset their recording.
This call is equivalent to ask each command buffer from
this pool to do vkResetCommandBuffer.
Bug: 415349936
Change-Id: I7a9c76ab16463c16f48336fcef34f532410aac41
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
In common cases, command buffer is recorded
right before submission. re-submission of pre-recorded
command buffer multiple times is uncommon.
However, it is still a valid case that should be properly
handled by snapshot save and load.
This cl adds code inside SubDecoder to track the dependency
of each Cmd, and also snapshot save and load vkQueueFlushCommandsGOOGLE.
Bug: 415349936
Change-Id: I11b462203722518ea82609613c0874d07bf5be53
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
This is an effort to simplify the dependency handling
in VkReconstruct.
A new DepGraph class is used to just record the
vk object dependency.
The save and load order is based on the time stamp,
not by topo order from dep graph anymore.
Bug: 407856927
Change-Id: Ibeb89dc01d9f1d007c3221b2dc1ce93957165df1
... and fix up include paths.
Bug: b/369615058
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Change-Id: Ia407b250ae10ff1d9dc99fff32099aca61219d09
... since `BoxedHandleManager` should, well, manager the handles.
This simplifies `VkDecoderGlobalState` a little bit and should also
allow us to remove a bunch of functions that no longer need to
depend on `VkDecoderGlobalState`.
Bug: b/369615058
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Test: cvd snapshot_take --force \
--auto_suspend \
--snapshot_path=/tmp/snapshot1
Test: cvd reset -y
Test: cvd create --snapshot_path=/tmp/snapshot1
Change-Id: I9d52a12a2fe1e7394259fff0c25075fd50c7cfca
... to break the recursive behavior of the snapshot load having a callstack with
VkDecoderSnapshot -> VkReoncstruction -> VkDecoder -> VkDecoderSnapshot so that
locking and thread safety annotations can be preserved in VkDecoderSnapshot.
Follow up to aosp/3412302.
Bug: b/383139165
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Test: cvd snapshot_take --snapshot_path=<>
Test: cvd create --snapshot_path=<>
Change-Id: I5a914e2e81574b937d6f684fba43acc1af311c3f
As the mReconstructionMutex will be acuquired repeatedly in the
following decoder thread, locking it at the beginning of load call
will prevent decoder from acquiring it and stall the loader.
note: this is auto-generated code, it adds back the mReconstructionMutex
back into save; but remove it from load: partially undo aosp/3412302
Bug: 370344466
Change-Id: I72735494d41456c06d44c25c8e652bad9dd75ac6
Replace tryLock / unlock with regular scoped lock now that the
"extra handles" have been moved out of VkReconstruction and into
the VkSnapshotApiCallInfo.
Switch to regular std::mutex and std::lock_guard.
Annotate mReconstruction with GUARDED_BY to start to get more
thread safety analysis.
Bug: b/383139165
Test: m
Change-Id: I3b017887418466d3ced9119bed0ba7279ee55bdd
... so that `VkDecoderGlobalState` can append additional information
needed for snapshotting. Specifically, `VkDecoderGlobalState` may create
additional boxed handles that are not visible directly in the API surface.
For example, `vkCreateDevice()` creates boxed handles for the `VkQueue`-s
and `vkCreateDescriptorPool()` creates boxed handles for pre-allocated
`VkDescriptorSets`. These boxed handles are not recoverable from the API
for `vkCreateDevice()` nor `vkCreateDescriptorPool()` directly. This was
previously worked around by just sticking the extra boxed handles in
`VkReconstruction::mExtraHandlesForNextApi` but this is not thread safe.
Instead, let's give `VkDecoderGlobalState` and `VkDecoderSnapshot` exclusive
access to individual `VkSnapshotApiCallInfo` objects.
Bug: b/383139165
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Change-Id: I158b12d38584ca964af841e77d1d58a9f6901613
Removes the additional saving of opcode and packet len as this is
all available from within the packet itself.
Removes the "trace" position from `VulkanMemReadingStream` as these
seemed to only be used for getting the packet start and packet size
but these are already available.
Bug: b/383139165
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader
Change-Id: I2842c866a0bf10d117a8908fa6a0a94c4b83ac53
1, This will make sure we property save and load DescriptorSet
when VulkanBatchedDescriptorSetUpdate feature is turned off.
2, also introduce generic vk handle to represent action api
such as vkUpddateDescriptorSets, vkCmd***, so they can fit
into the dependency graph to make save and load easier
Bug: 370344466
Change-Id: I3fbeeb46c88dd2f397dafc95f5c1eb143fb75062
Add missing alias for the vkCmd function to the vk.xml to be
able to use it correctly at the host side decoder and subdecoder.
Bug: 357829977
Test: dEQP-VK.dynamic_state.monolithic.line_width.
Change-Id: If81e932ae9527eab8d0b09e2c3446f2f4c526bc6
With Mesa in the Emulator manifest, all Google projects
can just run codegen from that directory.
It has a deeper Git history, but the biggest win of the
dual upstream strategy is it only implies two levels
of synchronization:
1) mesa -> AOSP mesa (doable via Skia autorollers, other teams do
it)
2) AOSP main -> mesa (doable by a rotation of even long-term Gitlab
CI bot)
(2) depends on the volume of commits, which data indicates is
5/per month maybe.
BUG=374306378
TEST=CI
Change-Id: I667e2b4518837326c13cbac4af6d6d2ea7402112
With recent mesa related changes, we started using a recent version of
vk.xml and this promoted extension was being used as EXT in our codegen
scripts. This resulted in some code loss, skips on pNext chain of
commands sent from the guest side and eventually CTS/dEQP failures.
Updating vulkan headers partially with this change to accomodate KHR
version of the extension correctly.
Bug: b/357832421
Test: dEQP-VK.api.info.vulkan1p2_limits_validation*
Change-Id: I53fbb2742a846dbce55080deb46f5e4fd46e6c11
We have two versions of the same code, and we keep it
in sync via batch updates.
BUG=369906368
TEST=CI
Change-Id: I6852092fdd9e8a72d9921e693870722337c376cb
Mostly just change the locations of directories.
One exception is aosp/3271678, which needs to land in the
Mesa codegen directory.
For workflows without an AOSP tree, one can just pass in
the path to Mesa tree.
Mesa uses a newer version of vk.xml than the host does,
so some changes are observed.
BUG=369200554
TEST=generate-gfxstream-vulkan.sh in AOSP
or
cd ~/
git clone https://gitlab.freedesktop.org/mesa/mesa.git
cd ${gfxstream_dir}
./scripts/generate-gfxstream-vulkan.sh ~/mesa
Change-Id: I5a023ed4d8788a31f352d017f321656c7b7a7410
Private data slot types are required to support VK_EXT_private_data
extension. dEQP tests require some additional changes for handle
remapping over uint64_t types, which will be submitted later.
Bug: 368009403
Test: codegen & build & presubmit
Change-Id: If97478293fd8009a4279861fcbd780069708ab0f
* changes:
vkCreateInfo: support VkImageDrmFormatModifierListCreateInfoEXT
vkGetPhysicalDeviceImageFormatProperties2: support drm modifiers
vkAllocateMemory: support DRM format modifiers for dmabuf memory
Force request VK_EXT_image_drm_format_modifier in vkCreateDevice
Enable VK_EXT_image_drm_format_modifier on Linux guests
Enable VK_EXT_image_drm_format_modifier in cerealgenerator.py
Revert "HACK: gfxstream: guest: mesa: force non-modifier path"
Add missing includes
Add the extension to list in cerealgenerator.py, rerun
scripts/generate-gfxstream-vulkan.sh
Bug: 328011003
Test: vkvcube-wayland + kumquat on the entire CL chain
Change-Id: If5cf2b04e9fb03e2f484fee12bbe13572c945b8b
We acquire the lock when createExtraHandlecsForNextApi is called. But
depending on config, vkCreateDescriptorPool may or may not call
createExtraHandlesForNextApi, which results in inconsistency of the lock
state when calling snapshot()->vkCreateDescriptorPool.
We add a tryLock so that it always acquires the lock before modifying
mReconstruction.
Bug: 349648408
Test: VulkanBatchedDescriptorSetUpdate
Change-Id: I8f582580e01916edce042db192c497c8dd7a32d2
Add VK_KHR_ray_tracing_pipeline and VK_KHR_pipeline_library
extensions support which are used by some test applications.
Bug: 351729443
Test: run benchmark tests on MacOS
Change-Id: Ice76fbc1b431b6ee74b8df587719fe4f13f457a8
New protocol which instructs the host to share sync descriptor
with ExternalObjectManager.
BUG=350965057
TEST=compile
Change-Id: Ia009c0278a02d631ff2f8edd18bee85bbaa030f3