55 Commits
Author SHA1 Message Date
Bo Hu 6b340cf804 [vulkan snapshot]: handle event save and load
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
2025-07-10 23:58:52 +00:00
Serdar Kocdemir 515f98416c Remove unnecessary parentheses in codegen
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
2025-06-30 20:27:46 +00:00
Serdar Kocdemir 160ecf72d3 Check size for memcpy operations
Avoid nullptr from zero-size allocations being passed
into the copy functions, which is causing UB errors.
(regen auto generated code)

Bug: 329094533
Test: CI
Change-Id: I9d5a76f58585449d333ce56539e877ecb47c63e6
2025-06-17 21:04:07 +00:00
Jason Macnak 39330aa245 Use VkSnapshotApiCallHandle outside of VkReconstruction
... 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
2025-06-05 17:26:09 +00:00
Serdar Kocdemir f29650f7f5 Regerenate autogenerated code
.. after recent changes on the build script due to xml file
location change.

Bug: 417150515
Test: CI
Change-Id: I04b2e40778fc8f2c832a4c9204a411fe9895dd08
2025-05-14 14:58:34 +01:00
Serdar Kocdemir 60beb01f14 Update vulkan headers to v313
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
2025-05-14 12:36:42 +01:00
Serdar Kocdemir 1f77d6a2b8 Mark VK_KHR_ray_tracing_pipeline dispatch only
Bug: 417150515
Test: build
Change-Id: I543e9a24e719700a706a45f3174b8a9b74516beb
2025-05-12 23:55:50 +01:00
Jason Macnak 453d39675a Use Gfxstream's Stream for save/load interface
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
2025-05-07 12:35:25 -07:00
Bo Hu 8a413ae915 [vulkan snapshot]: save command recording
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
2025-05-05 16:46:19 -07:00
Jason Macnak b001c743d3 Update non interface parts of Gfxstream to use new base lib
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
2025-05-01 16:29:17 +00:00
Jason Macnak 1c33a8d747 Update to new logging
Bug: b/403363880
Test: m
Change-Id: I931edf878a023864c7208f69e1eba7393cfce8b6
2025-04-11 14:34:57 -07:00
Jason Macnak a43dfa9f3c Add gfxstream host logging lib
... to eventually replace the existing host-common/logging. This
is needed to break up the circular dependency between aemu-base and
aemu-host-common, so that we can move parts of aemu-base and
aemu-host-common into hardware/google/gfxstream, in order to make
Gfxstream a self contained library for building.

Hooks up the existing host-common/logging via the
RenderLibImpl::setLogger() call.

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: Id52c6f756f85d0a5fb948601228234d7a84a14c2
2025-04-09 13:11:08 -07:00
Serdar Kocdemir 2870798741 Update generated code for dispatcher checks
Adds validity conditioning before making driver calls
to be able to handle some fatal errors later on.

Bug: 383272733
Test: CI
Change-Id: Ie9898aeb9f15ad5388ee9db21559233eb43b5053
2025-03-06 12:04:08 +00:00
Jason Macnak a7985e546a Update variable names to avoid -Wshadow error
... as vkCmdUpdateBuffer() uses these param names.

Bug: b/399867568
Test: build
Change-Id: I0d83e1a43926d76070030717f7dbebf465c9426a
2025-03-05 08:02:31 -08:00
Jason Macnak 5d86d48212 Pass VkSnapshotApiCallInfo-s through VkDecoderGlobalState
... 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
2024-12-12 08:49:24 -08:00
Joshua Duong 3e073ad037 Update auto-generated comments.
codegen was moved from gfxstream-protocols to mesa3d.

Bug: 377677250
Test: N/A
Change-Id: I56674e2fb312a9faf6f6e42391b08f514f638ec0
2024-11-11 08:15:29 -08:00
Serdar Kocdemir 4d94b08137 Fix vkCmdSetLineStippleKHR decoding
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
2024-10-28 19:50:35 +00:00
Serdar Kocdemir 8751452348 Keep VK_EXT_line_rasterization in codegen
Adding the generated code back for the EXT version of the extension.

Bug: 357829977
Test: deqp
Change-Id: Ibe853ace8234fac725c2653805fce48a21d93784
2024-10-28 18:18:27 +00:00
Gurchetan Singh 838dd1d614 gfxstream: rerun codegen from external/mesa3d
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
2024-10-21 14:22:42 -07:00
Serdar Kocdemir d41a3b97b5 Update autogen for VK_KHR_line_rasterization
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
2024-10-10 10:57:01 +01:00
Gurchetan Singh 4943dccf17 gfxstream: modify script to point to gfxstream version of codgen
We have two versions of the same code, and we keep it
in sync via batch updates.

BUG=369906368
TEST=CI

Change-Id: I6852092fdd9e8a72d9921e693870722337c376cb
2024-09-30 21:27:30 +00:00
Gurchetan Singh 08f5c21ebc gfxstream: fix scripts/generate-gfxstream-vulkan.sh
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
2024-09-25 08:56:30 -07:00
Jason Macnak 9bc12d915e Add perfetto tracing to host renderer
... to aid debugging.

Bug: b/364967041
Test: cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader
Test: perfetto capture and open in ui.perfetto.dev
Change-Id: Ieda7f9ce8d0a0923a989cd201438819568cab140
2024-09-05 17:24:05 -07:00
Gurchetan Singh 822d36e24f gfxstream: host: don't abort when unbox fails
Unboxing fails if a NULL handle is passed in, triggering an abort.

However for vkCmdBeginTransformFeedbackEXT, this is perfectly
valid:

"For each element of pCounterBuffers that is VK_NULL_HANDLE,
transform feedback will start capturing vertex data to byte zero
in the corresponding bound transform feedback buffer."

BUG=349122558
TEST=run gfxbench manhattan_off on Intel

Change-Id: I62f2572ee637f0f9f72796fabdd64a7b3cc53006
2024-07-16 08:13:51 -07:00
Serdar Kocdemir eae7f2acf9 Add extensions used in test applications
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
2024-07-12 10:33:25 +00:00
Serdar Kocdemir 13cc4585ec Remove empty ifdef blocks after the codegen
Reduce clutter due to extensions related ifdef code block generation
and avoid changing many files when a new extension support is added
with partial functionality.

Test: run ./scripts/generate-gfxstream-vulkan.sh
Bug: 332482903
Change-Id: I8cb6ca546eb63746283eff14f0440c4aa68f0dc5
2024-07-03 23:43:28 +01:00
Serdar Kocdemir fa050d101b Remove direct usages of MoltenVK library functions
These APIs and the related extension are deprecated in favor of the new
metal_objects extension to make sure the loader can intercept them, so that the layers, such as VVL, would work fine.
Removes necessity to load functions directly from a separate dylib.
VK_MVK_moltenvk extension support is still passed to the guest side
due to the existing checks for enabling the AHB extension.

Bug: 333460957
Test: run with swiftshader, host and use-host-vulkan arguments on MacOS
Change-Id: I17ce958bc6498029ad4c525e80764060f88df118
2024-06-27 10:06:59 +00:00
Gurchetan Singh 91db8869db gfxstream: guest: add VK_EXT_color_write_enable
Zink uses this extension.

BUG=349122558
TEST=run zink

Change-Id: I25de9d8eccf738f0c0687ca6e8ce829860ed5084
2024-06-25 10:52:16 -07:00
Treehugger Robot 63101ef795 Merge changes from topic "revert-3125001-RTGKUHGTVU" into main
* changes:
  Reland "gfxstream: don't add external fences in destroyD..."
  Revert "Revert "gfxstream: stream-renderer: add waitSyncResource..."
  Revert "Revert "gfxstream: Add vkCmdPipelineBarrier2 implementat..."
  Revert "Revert "gfxstream: stream-renderer: Add missing mapping ..."
  Revert^2 "gfxstream: Fix synchronization issue"
  Revert "Revert "gfxstream: destroyDevicesLocked needs to use int..."
2024-06-17 14:02:21 +00:00
Serdar Kocdemir 75f3a3e501 Add VK_EXT_debug_report extension support
This extension is enabled from the platform side via the Android
loader and the applications using the functions or structures of
it would crash even if they check the support of the extension.
Guest callback addresses within the structures of this extension
cannot be used and are already being removed when creating the
instances.

Bug: b/332482903
Test: Run Khronos Vulkan samples
Change-Id: I474ad10ce36bc248d9e70210a7eee4d948197782
2024-06-17 09:27:18 +00:00
Gurchetan Singh 1da942b1dd Revert "Revert "gfxstream: Add vkCmdPipelineBarrier2 implementat..."
Revert submission 3125001

BUG=346348303
TEST=atbd

Change-Id: Iefe1c2754ee522380647fa226e84fec653154da3
2024-06-14 07:48:21 -07:00
Gurchetan Singh 79959280c0 Revert "gfxstream: Add vkCmdPipelineBarrier2 implementation in VkDecoderGlobalState"
BUG=346348303
TEST=todo

This reverts commit c4de357e4f.

Change-Id: I950ddea16a83f3e50c356e90e6cf0826de908c92
2024-06-13 18:31:45 +00:00
Aaron Ruby c4de357e4f gfxstream: Add vkCmdPipelineBarrier2 implementation in VkDecoderGlobalState
Useful for specializing this function.

BUG=343234676
TEST=compile

Change-Id: Ic6bff75d2a6e227a0b17ebf35cd128d1693de612
2024-06-06 16:21:07 -07:00
Serdar Kocdemir 81b0a2863e Mark VK_MVK_moltenvk extension as supported on vulkan
MoltenVK extension code was not being generated because of the
missing "supported=vulkan" tag required by the code generator.

Bug: 332964912
Bug: 339094207
Test: build and run with -use-host-vulkan mode
Change-Id: I923c0cb6f3438b4b3aa3c102098cdcb01f7b6700
2024-05-08 16:13:20 +00:00
Serdar Kocdemir 397a63ffae Add VK_EXT_metal_objects support
Adding VK_EXT_metal_objects to the supported extensions
for the host side operations.

Bug: 332964912
Test: build
Change-Id: I8fbad4316be16e2981ca6de9bea6fc505b4fd59e
2024-05-07 12:29:04 +00:00
Serdar Kocdemir 2631e3b825 Add support for VK_EXT_robustness2
This extension is required to get Vulkan Capabilities
Viewer working correctly in the emulator.

Bug: 327501571
Test: Run vk caps viewer on the emulator
Change-Id: Ie59eb0188285f0147f4f1aa642fb69593b330c35
2024-03-20 15:10:22 +00:00
Serdar Kocdemir 80c47dc5ac Add VK_EXT_validation_features to host modules
This is another extension used for vulkan validation.

Bug: 327501571
Test: Build & run an app with validation layers
Change-Id: I5fbd7c53176b19a40f2191b6e6697146907a4dad
2024-03-14 17:47:57 +00:00
Treehugger Robot b8b87f0ed5 Merge "Better track color buffer usage in Vulkan" into main 2024-03-09 03:11:32 +00:00
Yahan Zhou cfcfb8736c Better track color buffer usage in Vulkan
Sometimes guest renders to an AHB without calling
vkQueueSignalReleaseImageANDROIDAsyncGOOGLE. This would result in the
color buffer not being updated from Vulkan.

This commit tracks the situation that AHB is rendered to, and copies its
content to color buffer.

Note that it adds extra wait, which could hurt performance.

Bug: 327522469
Test: run Chrome with -gpu swiftshader
Change-Id: I3687a68eb222039291c6f73fc65fb0e9ec0b443b
2024-03-07 13:59:27 -08:00
Serdar Kocdemir eee42bee76 Add VK_EXT_debug_utils to host modules for codegen
Fixes emulator crashes when the validation layers
are enabled on the guest side.

Bug: 327501571
Change-Id: I6479f2e08a93890d4502943f1eba1b64bfb94a24
2024-03-07 16:47:51 +00:00
Yahan Zhou b01fc5ab1b Add VK_EXT_fragment_density_map for Chrome
Bug: 320855472
Test: media_unittests from rvc_car_release
Change-Id: I7af3265fc24d0a2265fac59e0041c318f75be99d
2024-01-18 13:26:26 -08:00
Gurchetan Singh c4444b82e3 gfxstream: mega-change to support guest Linux WSI with gfxstream
This is a mega-change to support Linux guest WSI with gfxstream.
We tried to do a branch where every commit was buildable and
runnable, but that quickly proved unworkable. So we squashed
the branch into a mega-change.

Zink provides the GL implementation for Linux guests, so we just
needed to implement the proper Vulkan Wayland/X11 WSI
entrypoints.

The overall strategy to support this is to use Mesa's WSI
functions.  The Vulkan WSI layer was also considered:

https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer

But it was less maintained compared to Mesa.  The way Mesa common
layers communicate with drivers is the through base objects
embedded in driver and a common dispatch layer:

https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/docs/vulkan/dispatch.rst
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/docs/vulkan/base-objs.rst

Our objects are defined in gfxstream_vk_private.h.  Currently,
Mesa-derived Vulkan objects just serve as shim to gfxstream
Vulkan’s internal handle mapping. Long-term, we can use
Mesa-derived objects inside gfxstream guest Vulkan exclusively.

The flow is typically inside a Vulkan entrypoint is:

- VK_FROM_HANDLE(vk-object) to convert to a gfxstream_vk_obj
  object
- Call ResourceTracker::func(gfxstream_vk_obj->internal) or
  VkEncoder::func(gfxstream_vk_obj>internal)
- Return result

A good follow-up cleanup would be to delete older gfxstream
objects.  For example, we now have struct gfxstream_vk_device
and info_VkDevice in ResourceTracker.

Most of this logic was auto-generated and included in
func_table.cpp. Some vulkan functions were too difficult to
auto-generate or required special logic, and these are included
in gfxstream_vk_device.cpp.  For example, anything that needs to
setup the HostConnection requires special handling.

Android Blueprint support is added to the parts of Mesa needed
to build the Vulkan runtime.  One thing to call out it's
required to build the guest/vulkan_enc and guest/vulkan files
in the same shared library now, when previously have
libvulkan_enc.so and libvulkan_ranchu.so was sufficient
[otherwise, some weak pointer logic wouldn't work].

A side effect of this is libOpenglSystem must also be a static
lib, and so should libandroid_aemu too.  That conceptually makes
sense and the Meson build had been doing this all a long.  We
can probably transition everything besides libGLESv1_emulation.so,
libGLESv2_emulation.so and libvulkan_ranchu.so to be static.

This requires changes in the end2end tests, because since each
HostConnection is separate and internal to it's constituent
library. Lifetimes need to be managed separately: for example
the HostConnection instance created by the end2end tests would
not be visible inside libvulkan_ranchu.so anymore. Probably the
best solution would be improve the testing facade so a
HostConnection represents one virtio-gpu context, while some
other entity represents a virtio-gpu device (client-server
would work).

vk.xml was modified, but change sent to Khronos:

https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/6325

Fuchsia builds still need to be migrated, but they already have
Fuchsia Mesa with all the build rules so that shouldn't be too
bad. Just need to copy them over the gfxstream/Mesa hybrid.

The new command for building Linux guests is:

meson amd64-build/ -Dvulkan-drivers="gfxstream" -Dgallium-drivers="" -Dvk-no-nir=true -Dopengl=false

Big shout-out to Aaron Ruby, who did most of the gnarly codegen
needed to get the function table logic to work.

BUG=313466265
BUG=298679844
TEST=
     * Run Weston/vkcube on Linux and automotive platform
     * launch_cvd --gpu_mode=gfxstream vkcube
     * launch_cvd --gpu_mod=gfxstream_guest_angle
     * vkcube + 3D Mark Slingshot extreme work with guest ANGLE and
       GL-VK interop
     * GfxstreamEnd2EndTests
     * Some select dEQP tests

Aaron Ruby (46):
  gfxstream: function table: remove entry points that are hand-written.
  gfxstream: function table: more changes
  gfxstream: function table: scope internal_arrays to encoder
  gfxstream: function table: autogenerate compoundType params
  gfxstream: add handwritten EnumeratePhysicalDeviceGroup entrypoint.
  gfxstream: function table: handle nested handle arrays
  gfxstream: function table: adding some handwritten implementations
  gfxstream: revert some unnecessary changes
  gfxstream: use vk_object_zalloc/free instead of vk_zalloc/free.
  gfxstream: revert most gfxstream objects to use vk_object_base
  gfxstream: function table: handwritten commmand-buffers/pools
  gfxstream: codegen functionality to handle special param
  gfxstream: function table: random fixes
  gfxstream: add vk_command_buffer_ops handlers
  gfxstream: func_table.py: Codegen support for nested compound type
  gfxstream: remove handwritten/add autogen entry points
  gfxstream: add gfxstream_vk_device.cpp
  gfxstream: query device and instance extensions early
  gfxstream: func_table: explicit allocation for nested arrays/compound
    types
  gfxstream: goldfish_vulkan: fix commandBuffer allocation.
  gfxstream: meson: Raise api_version in ICD config to 1.1.
  gfxstream: function table: add more handwritten entries
  gfxstream: goldfish_vulkan: update VkDescriptorSetAllocateInfo logic
  gfxstream: function table: NULL check on internal_object dereference
  gfxstream: function table: Remove POSTPROCESSES handling from
    functable
  gfxstream: mesa: Add 'gfxstream' as a -Dvulkan-drivers
  gfxstream: ResourceTracker: add some allowedExtensions
  gfxstream: gfxstream_vk_device: add wsi_common_entrypoints
  gfxstream: Move instance handling into gfxstream_vk_device.cpp
  gfxstream: ResourceTracker: Enable Linux WSI-related extensions
  gfxstream: wsi: add wsi_device initialization
  gfxstream: gfxstream_vk_device: use Mesa common physical device
    management
  gfxstream: ResourceTracker: translate mesa objects in user buffer
  gfxstream: exclude VkSampler and VkDescriptorSet objects from
    translation
  gfxstream: Add guest-side external memory support with colorBuffers.
  gfxstream: function table: Modify semaphoreList inputs to no-op
    semaphores
  gfxstream: function table: Allow VK_NULL_HANDLE for free/destroy APIs.
  gfxstream: cereal: Add VK_EXT_depth_clip_enable as supported feature.
  gfxstream: vulkan_enc: un-namespace vk_util.h and vk_struct_id.h
  gfxstream: gfxstream_vk_device.cpp: Support VK_KHR_surface and
    VK_*_surface
  gfxstream: vulkan_enc: Add support for Mesa-only extensions.
  gfxstream: ResourceTracker: Use DEVICE_TYPE_VIRTUAL_GPU always
  gfxstream: platform: add dma-buf export support with dedicatedBuffer.
  gfxstream: ResourceTracker: add VK_EXT_depth_clip_enable allowed
    extension
  gfxstream: ResourceTracker: external memory via QNX_screen_buffer
    extension
  gfxstream: Add VK_QNX_external_memory_screen_buffer to VulkanDispatch

Gurchetan Singh (18):
  gfxstream: mesa: write Android.bp files
  gfxstream: generate gfxstream_vk_entrypoints.{c, h}
  gfxstream: vulkan_enc: add gfxstream_vk_private.h (objects)
  gfxstream: function table: modify function table to use gfxstream_vk_*
  gfxstream: compiles
  gfxstream: build system improvements
  gfxstream: ResourceTracker: don't crash without
    VkBindImageMemorySwapchainInfoKHR
  gfxstream: vk.xml: make some vkAcquireImageANDROID params optional
  gfxstream_vk_device: filter out swapchain maintenance guest side
  gfxstream: end2end: fixes for End2End tests
  gfxstream: func_table: custom vkEnumerateInstanceLayerProperties
  gfxstream: add VK_EXT_DEBUG_UTILS_EXTENSION_NAME into Mesa list
  gfxstream: clang-format guest code
  gfxstream: libandroid AEMU static
  gfxstream: vkEnumerateInstanceVersion
  gfxstream: vkCreateComputePipeLines
  gfxstream: make end2end tests happy
  gfxstream: delete prior vk.xml, vk_icd_gen.py

Change-Id: Ic4cc50d5098dddd77c9265afa8f432a2fdea8845
2023-12-27 10:22:48 -08:00
Igor Chernyshev 5ef37b16f4 Add VK_EXT_debug_utils and VK_EXT_scalar_block_layout
Bug: 317131873
Bug: 316936776
Change-Id: I60b48b31ada43ca7295d2ff84762817e2f640ede
2023-12-19 15:58:51 -08:00
Yahan Zhou c90b36015d Add VK_EXT_vertex_attribute_divisor support for guest ANGLE
Bug: 236282567
Test: boot AEMU with -guest-angle
Change-Id: I20ac7ccf9d4d3f24e9c31d4e05fda1bc18832940
2023-12-19 12:37:01 -08:00
Gurchetan Singh 2cf08adf4c gfxstream: use standard Vulkan headers and new auto-gen flow
This modifies gfxstream to use standard Vulkan headers,
and updates to 1.3.269.

Previously, the headers were mostly standard, but added in
vk_android_native_buffer into vulkan_core.h.  That breaks down
when using auto-gen scripts from outside gfxstream, which will
happen in a subsequent patchset.

For vk_native_buffer_android, we can simply provide a
vk_android_native_buffer_gfxstream.h.

Long-term, vk_native_buffer_android.h should be deprecated in
favor of VK_ANDROID_external_memory_android_hardware_buffer, in
Android's libvulkan and elsewhere.

For the Vulkan headers, the new procedure is generate them in the
directions found here in the following repos:

https://github.com/KhronosGroup/Vulkan-Headers
https://github.com/KhronosGroup/Vulkan-Hpp

Those headers can be copied over using cp.  For gfxstream encoder
+ decoders, that's still generated via ./generate-gfxstream-vulkan.sh

The only catch is you must use the same vk.xml for Vulkan-Headers,
Vulkan-Hpp, and for the cereal generator.  The recommended flow
is use whatever the xml is in Vulkan-Headers ToT and copy to
Vulkan-Hpp and cerealgenerator.py before running those scripts.

The End2End tests that relied on vk_android_native_buffer were
also modified.  Long-term, the AHB extension could be used
instead of ANB for tests.

BUG=310206667
TEST=launch_cvd --gpu_mode=gfxstream_guest_angle

Change-Id: Ib43d8555cf37a9e9a7189ec7597f78f12cd53b5d
2023-11-13 09:54:42 -08:00
Yahan Zhou 935a7cbe60 Add extension VK_EXT_graphics_pipeline_library
It is used in this test:
dEQP-VK.pipeline.pipeline_library.graphics_library.fast.4

Note that the test is supposed to check for extension support before
using the extension, but the check doesn't seem to work.

Bug: 307550200
Test: dEQP-VK.pipeline.pipeline_library.graphics_library.fast.4
Change-Id: I3fa8ef493a455e7dd342bbce4795a83041d1e15f
2023-10-24 10:40:29 -07:00
Gurchetan Singh 31e4eb7a5c gfxstream: re-nuke unused gfxstream Vulkan extensions (host)
This a reland of aosp/2730996 (host).

Host side landing of prior change.  Separating them out is useful
for testing.

BUG=298704840
TEST=compile

Change-Id: I5783e7e2ea63bbf72b757d00d4126855659f1b19
2023-10-03 11:13:07 -07:00
AWoloszyn db2bcb48c9 Fix for compressed textures when using CopyCommands2
Test: Running dEQP-VK.api.copy_and_blit.copy_commands2.image_to_image.all_formats.{eac|astc|etc).*
Bug: 300460096
Change-Id: I56b094411e7cf6dbe7323796338e4032c42ebd71
2023-09-22 17:52:14 +00:00
Jason Macnak 9919fbf12f Move existing vulkan codegen into nested vulkan-docs subdirectory
Bug: b/292257025
Test: ./scripts/generate-vulkan-sources.sh
Change-Id: I8994625ffa20ff56579a7ef1992844f580a6d88a
2023-09-11 12:15:13 -07:00
Yahan Zhou 5a86aadc4a Revert "gfxstream: nuke unused Vulkan extensions"
Revert submission 2730996

Reason for revert: potential breakage b/298477725

Reverted changes: /q/submissionid:2730996

Change-Id: I483030e5ce23445eb8ec32fc3a9942d42ac97b79
2023-08-31 22:08:19 +00:00