| commit | 1d850ec8326de802991cd6e30124669dbae41c9b | [log] [tgz] |
|---|---|---|
| author | Bryan Clark <bryanclark@google.com> | Thu May 22 17:00:19 2025 -0700 |
| committer | Android (Google) Code Review <android-gerrit@google.com> | Thu May 22 17:00:19 2025 -0700 |
| tree | 4d39f1c4fa1eff664cbd3cf13e2bbfbf5b6f29e5 | |
| parent | c36ccdaf3f92f415eec080414947cef334feb543 [diff] |
Revert "Add RGBA to RGB565 conversion." This reverts commit c36ccdaf3f92f415eec080414947cef334feb543. Reason for revert: Causes OOM failures in some g3 tests Bug: 417208550 Change-Id: Ie5d5c66790bd84029ac7813c54e9658e493171b4
Graphics Streaming Kit, colloquially known as Gfxstream and previously known as Vulkan Cereal, is a collection of code generators and libraries for streaming rendering APIs from one place to another.
The Bazel build current supports building the host server which is typically used for Android virtual device host tooling.
cd <gfxstream project> bazel build ... bazel test ...
The CMake build has historically been used for building the host backend for Goldfish.
The CMake build can be used from either a standalone Gfxstream checkout or from inside an Android repo.
Then,
mkdir build cd build cmake .. -G Ninja ninja
For validating a Goldfish build,
cd <aosp/emu-main-dev repo> cd external/qemu python android/build/python/cmake.py --gfxstream
The Meson build has historically been used for building the backend for Linux guest on Linux host use cases.
cd <gfxstream project>
meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
The Android Soong build is used for building the guest components for virtual device (Cuttlefish, Goldfish, etc) images and was previously used for building the host backend for virtual device host tools.
Please follow the instructions here for getting started with Android development and setting up a repo.
Then,
m libgfxstream_backend
and libgfxstream_backend.so can be found in out/host.
For validating changes, consider running
cd hardware/google/gfxstream mma
to build everything inside of the Gfxstream directory.
Make sure the latest CMake is installed. Make sure Visual Studio 2019 is installed on your system along with all the Clang C++ toolchain components. Then:
mkdir build cd build cmake . ../ -A x64 -T ClangCL
A solution file should be generated. Then open the solution file in Visual studio and build the gfxstream_backend target.
First, build build/gfxstream-generic-apigen. Then run:
scripts/generate-apigen-source.sh
To re-generate both guest and Vulkan code, please run:
scripts/generate-gfxstream-vulkan.sh
There are Android mock tests available, runnable on Linux. To build these tests, run:
m GfxstreamEnd2EndTests
There are a bunch of test executables generated. They require libEGL.dll and libGLESv2.dll and vulkan-1.dll to be available, possibly from your GPU vendor or ANGLE, in the %PATH%.
The host renderer has optional support for Perfetto tracing which can be enabled by defining GFXSTREAM_BUILD_WITH_TRACING (enabled by default on Android builds).
The perfetto and traced tools from Perfetto should be installed. Please see the Perfetto Quickstart or follow these short form instructions:
cd <your Android repo>/external/perfetto ./tools/install-build-deps ./tools/gn gen --args='is_debug=false' out/linux ./tools/ninja -C out/linux traced perfetto
To capture a trace on Linux, start the Perfetto daemon:
./out/linux/traced
Then, run Gfxstream with Cuttlefish:
cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader
Next, start a trace capture with:
./out/linux/perfetto --txt -c gfxstream_trace.cfg -o gfxstream_trace.perfetto
with gfxstream_trace.cfg containing the following or similar:
buffers {
size_kb: 4096
}
data_sources {
config {
name: "track_event"
track_event_config {
}
}
}
Next, end the trace capture with Ctrl + C.
Finally, open https://ui.perfetto.dev/ in your webbrowser and use “Open trace file” to view the trace.
gfxstream vulkan is the most actively developed component. Some key commponents of the current design include:
struct gfxstream_vk_device and the gfxstream object goldfish_device both are internal representations of Vulkan opaque handle VkDevice. The Mesa object is used first, since Mesa provides dispatch. The Mesa object contains a key to the hash table to get a gfxstream internal object (for example, gfxstream_vk_device::internal_object). Eventually, gfxstream objects will be phased out and Mesa objects used exclusively.Gfxstream is a first class open source project, and welcomes new contributors. There are many interesting projects available, for new and experienced software enthusiasts. Some ideas include:
Please reach out to your local gfxstreamist today if you are interested!
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.