1# Graphics Streaming Kit (formerly: Vulkan Cereal) 2 3Graphics Streaming Kit is a code generator that makes it easier to serialize 4and forward graphics API calls from one place to another: 5 6- From a virtual machine guest to host for virtualized graphics 7- From one process to another for IPC graphics 8- From one computer to another via network sockets 9 10# Build: Linux 11 12Make sure the latest CMake is installed. 13Make sure the opengl lib is installed. Otherwise, sudo apt-get install 14libglu1-mesa-dev freeglut3-dev mesa-common-dev 15Make sure you are using Clang as your `CC` and clang++ as your`CXX`. Then 16 17 mkdir build 18 cd build 19 cmake . ../ 20 make -j24 21 22Unit tests: 23 24 make test 25 26# Build: Windows 27 28Make sure the latest CMake is installed. Make sure Visual Studio 2019 is 29installed on your system along with all the Clang C++ toolchain components. 30Then 31 32 mkdir build 33 cd build 34 cmake . ../ -A x64 -T ClangCL 35 36A solution file should be generated. Then open the solution file in Visual 37studio and build the `gfxstream_backend` target. 38 39# Build: Android for host 40 41Be in the Android build system. Then 42 43 m libgfxstream_backend 44 45It then ends up in `out/host` 46 47This also builds for Android on-device. 48 49# Output artifacts 50 51 libgfxstream_backend.(dll|so|dylib) 52 53# Regenerating Vulkan code 54 55 scripts/generate-vulkan-sources.sh 56 57If you're in an AOSP checkout, this will also modify contents of the guest Vulkan encoder in `../goldfish-opengl`. 58 59# Regenerating GLES/RenderControl code 60 61First, build `build/gfxstream-generic-apigen`. Then run 62 63 scripts/generate-apigen-source.sh 64 65# Tests 66 67## Linux Tests 68 69There are a bunch of test executables generated. They require `libEGL.so` and `libGLESv2.so` and `libvulkan.so` to be available, possibly from your GPU vendor or ANGLE, in the `$LD_LIBRARY_PATH`. 70 71## Windows Tests 72 73There 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%`. 74 75## Android Host Tests 76 77These are currently not built due to the dependency on system libEGL/libvulkan to run correctly. 78 79# Structure 80 81- `CMakeLists.txt`: specifies all host-side build targets. This includes all 82 backends along with client/server setups that live only on the host. Some 83 - Backend implementations 84 - Implementations of the host side of various transports 85 - Frontends used for host-side testing with a mock implementation of guest 86 graphics stack (mainly Android) 87 - Frontends that result in actual Linux/macOS/Windows gles/vk libraries 88 (isolation / fault tolerance use case) 89- `Android.bp`: specifies all guest-side build targets for Android: 90 - Implementations of the guest side of various transports (above the kernel) 91 - Frontends 92- `BUILD.gn`: specifies all guest-side build targets for Fuchsia 93 - Implementations of the guest side of various transports (above the kernel) 94 - Frontends 95- `base/`: common libraries that are built for both the guest and host. 96 Contains utility code related to synchronization, threading, and suballocation. 97- `protocols/`: implementations of protocols for various graphics APIs. May contain 98code generators to make it easy to regen the protocol based on certain things. 99- `host-common/`: implementations of host-side support code that makes it 100 easier to run the server in a variety of virtual device environments. 101 Contains concrete implementations of auxiliary virtual devices such as 102 Address Space Device and Goldfish Pipe. 103- `stream-servers/`: implementations of various backends for various graphics 104 APIs that consume protocol. `gfxstream-virtio-gpu-renderer.cpp` contains a 105 virtio-gpu backend implementation. 106