| 1 |
#!/bin/bash |
| 2 |
# Copyright 2022 Android Open Source Project |
| 3 |
# SPDX-License-Identifier: MIT |
| 4 |
|
| 5 |
# Please run this from the Mesa codegen directory |
| 6 |
# >> cd ${mesa_dir}/src/gfxstream/codegen |
| 7 |
# >> ./generate-gfxstream-vulkan.sh ${gfxstream_dir} |
| 8 |
# |
| 9 |
# Note in AOSP, ${gfxstream_dir} is optional, and the script autodetects the |
| 10 |
# path to gfxstream. |
| 11 |
|
| 12 |
export MESA_DIR="$PWD/../../.." |
| 13 |
if [ -z "$1" ]; |
| 14 |
then |
| 15 |
export GFXSTREAM_DIR="$MESA_DIR/../../hardware/google/gfxstream" |
| 16 |
else |
| 17 |
export GFXSTREAM_DIR="$1" |
| 18 |
fi |
| 19 |
|
| 20 |
export PREFIX_DIR="src/gfxstream" |
| 21 |
|
| 22 |
# We should use just use one vk.xml eventually.. |
| 23 |
export VK_MESA_XML="$MESA_DIR/src/vulkan/registry/vk.xml" |
| 24 |
export VK_XML="$GFXSTREAM_DIR/third_party/vulkan_docs/xml/vk.xml" |
| 25 |
|
| 26 |
export GFXSTREAM_GUEST_ENCODER_DIR="/tmp/" |
| 27 |
export GFXSTREAM_HOST_DECODER_DIR="$GFXSTREAM_DIR/host/vulkan" |
| 28 |
export GFXSTREAM_OUTPUT_DIR="$GFXSTREAM_HOST_DECODER_DIR/cereal" |
| 29 |
export GFXSTREAM_SCRIPTS_DIR="$GFXSTREAM_DIR/scripts" |
| 30 |
|
| 31 |
export GEN_VK="$MESA_DIR/$PREFIX_DIR/codegen/scripts/genvk.py" |
| 32 |
export CUSTOM_XML="$MESA_DIR/$PREFIX_DIR/codegen/xml/vk_gfxstream.xml" |
| 33 |
|
| 34 |
python3 "$GEN_VK" -registry "$VK_XML" -registryGfxstream "$CUSTOM_XML" cereal -o "$GFXSTREAM_OUTPUT_DIR" |
| 35 |
|
| 36 |
export CEREAL_VARIANT=guest |
| 37 |
export GFXSTREAM_GUEST_ENCODER_DIR="$MESA_DIR/src/gfxstream/guest/vulkan_enc" |
| 38 |
python3 "$GEN_VK" -registry "$VK_MESA_XML" -registryGfxstream "$CUSTOM_XML" cereal -o /tmp/ |
| 39 |
|
| 40 |
# Should have a unified headers dir here: |
| 41 |
python3 "$GEN_VK" -registry "$CUSTOM_XML" vulkan_gfxstream.h -o "$GFXSTREAM_GUEST_ENCODER_DIR" |
| 42 |
python3 "$GEN_VK" -registry "$CUSTOM_XML" vulkan_gfxstream.h -o "$GFXSTREAM_HOST_DECODER_DIR" |