Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright 2022 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 16 | export GFXSTREAM_DIR=$(pwd) |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 17 | if [ -z "$1" ]; |
| 18 | then |
Gurchetan Singh | 08f5c21 | 2024-09-25 08:54:39 -0700 | [diff] [blame] | 19 | export MESA_DIR=$(pwd)/../../../external/mesa3d |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 20 | else |
Gurchetan Singh | 08f5c21 | 2024-09-25 08:54:39 -0700 | [diff] [blame] | 21 | export MESA_DIR=$1 |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 22 | fi |
| 23 | |
Gurchetan Singh | 4943dcc | 2024-09-26 15:29:27 -0700 | [diff] [blame] | 24 | export PREFIX_DIR=src/gfxstream |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 25 | |
Gurchetan Singh | 08f5c21 | 2024-09-25 08:54:39 -0700 | [diff] [blame] | 26 | # We should use just use one vk.xml eventually.. |
| 27 | export VK_MESA_XML=$MESA_DIR/src/vulkan/registry/vk.xml |
| 28 | export VK_XML=$GFXSTREAM_DIR/codegen/vulkan/vulkan-docs-next/xml/vk.xml |
Gurchetan Singh | 08f5c21 | 2024-09-25 08:54:39 -0700 | [diff] [blame] | 29 | |
| 30 | export GFXSTREAM_GUEST_ENCODER_DIR=/tmp/ |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 31 | export GFXSTREAM_HOST_DECODER_DIR=$GFXSTREAM_DIR/host/vulkan |
| 32 | export GFXSTREAM_OUTPUT_DIR=$GFXSTREAM_HOST_DECODER_DIR/cereal |
| 33 | export GFXSTREAM_SCRIPTS_DIR=$GFXSTREAM_DIR/scripts |
Gurchetan Singh | 4943dcc | 2024-09-26 15:29:27 -0700 | [diff] [blame] | 34 | |
| 35 | export GEN_VK=$GFXSTREAM_DIR/$PREFIX_DIR/codegen/scripts/genvk.py |
| 36 | export CUSTOM_XML=$GFXSTREAM_DIR/$PREFIX_DIR/codegen/xml/vk_gfxstream.xml |
| 37 | |
| 38 | # For testing Mesa codegen copy only |
| 39 | #export GEN_VK=$MESA_DIR/$PREFIX_DIR/codegen/scripts/genvk.py |
| 40 | #export CUSTOM_XML=$MESA_DIR/$PREFIX_DIR/codegen/xml/vk_gfxstream.xml |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 41 | |
| 42 | python3 $GEN_VK -registry $VK_XML -registryGfxstream $CUSTOM_XML cereal -o $GFXSTREAM_OUTPUT_DIR |
| 43 | |
Gurchetan Singh | 08f5c21 | 2024-09-25 08:54:39 -0700 | [diff] [blame] | 44 | export CEREAL_VARIANT=guest |
| 45 | export GFXSTREAM_GUEST_ENCODER_DIR=$GFXSTREAM_DIR/guest/vulkan_enc |
| 46 | python3 $GEN_VK -registry $VK_MESA_XML -registryGfxstream $CUSTOM_XML cereal -o /tmp/ |
| 47 | |
Gurchetan Singh | 401599f | 2023-11-07 17:21:56 -0800 | [diff] [blame] | 48 | # Should have a unified headers dir here: |
| 49 | python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_GUEST_ENCODER_DIR |
| 50 | python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_HOST_DECODER_DIR |