blob: 2623d4caf0bbf709889bc6c948c4912d6e1bcd6f [file] [log] [blame]
Gurchetan Singh401599f2023-11-07 17:21:56 -08001#!/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 Singh401599f2023-11-07 17:21:56 -080016export GFXSTREAM_DIR=$(pwd)
Gurchetan Singh401599f2023-11-07 17:21:56 -080017if [ -z "$1" ];
18then
Gurchetan Singh08f5c212024-09-25 08:54:39 -070019 export MESA_DIR=$(pwd)/../../../external/mesa3d
Gurchetan Singh401599f2023-11-07 17:21:56 -080020else
Gurchetan Singh08f5c212024-09-25 08:54:39 -070021 export MESA_DIR=$1
Gurchetan Singh401599f2023-11-07 17:21:56 -080022fi
23
Gurchetan Singh4943dcc2024-09-26 15:29:27 -070024export PREFIX_DIR=src/gfxstream
Gurchetan Singh401599f2023-11-07 17:21:56 -080025
Gurchetan Singh08f5c212024-09-25 08:54:39 -070026# We should use just use one vk.xml eventually..
27export VK_MESA_XML=$MESA_DIR/src/vulkan/registry/vk.xml
28export VK_XML=$GFXSTREAM_DIR/codegen/vulkan/vulkan-docs-next/xml/vk.xml
Gurchetan Singh08f5c212024-09-25 08:54:39 -070029
30export GFXSTREAM_GUEST_ENCODER_DIR=/tmp/
Gurchetan Singh401599f2023-11-07 17:21:56 -080031export GFXSTREAM_HOST_DECODER_DIR=$GFXSTREAM_DIR/host/vulkan
32export GFXSTREAM_OUTPUT_DIR=$GFXSTREAM_HOST_DECODER_DIR/cereal
33export GFXSTREAM_SCRIPTS_DIR=$GFXSTREAM_DIR/scripts
Gurchetan Singh4943dcc2024-09-26 15:29:27 -070034
35export GEN_VK=$GFXSTREAM_DIR/$PREFIX_DIR/codegen/scripts/genvk.py
36export 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 Singh401599f2023-11-07 17:21:56 -080041
42python3 $GEN_VK -registry $VK_XML -registryGfxstream $CUSTOM_XML cereal -o $GFXSTREAM_OUTPUT_DIR
43
Gurchetan Singh08f5c212024-09-25 08:54:39 -070044export CEREAL_VARIANT=guest
45export GFXSTREAM_GUEST_ENCODER_DIR=$GFXSTREAM_DIR/guest/vulkan_enc
46python3 $GEN_VK -registry $VK_MESA_XML -registryGfxstream $CUSTOM_XML cereal -o /tmp/
47
Gurchetan Singh401599f2023-11-07 17:21:56 -080048# Should have a unified headers dir here:
49python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_GUEST_ENCODER_DIR
50python3 $GEN_VK -registry $CUSTOM_XML vulkan_gfxstream.h -o $GFXSTREAM_HOST_DECODER_DIR