1#!/bin/sh
2
3# Copyright 2020 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.
16
17PROGRAM_PARAMETERS=""
18
19PROGRAM_DESCRIPTION=\
20"Regenerate static translator headers for EGL/GLES1/GLES2,3."
21
22ENTRIES_DIR=stream-servers/gl/OpenGLESDispatch
23HEADER_OUT_DIR=include/OpenGLESDispatch
24IMPL_OUT_DIR=stream-servers/gl/OpenGLESDispatch
25
26function gen_entries_with_mode() {
27    local mode=$1
28    local entries_file=$2
29    local output_path=$3
30    scripts/gen-entries.py --mode=$mode $entries_file --output=$output_path
31}
32
33function funcargs_header() {
34    gen_entries_with_mode funcargs $1 $2
35}
36
37function functions_header() {
38    gen_entries_with_mode functions $1 $2
39}
40
41function static_translator_namespaced_header() {
42    gen_entries_with_mode static_translator_namespaced_header $1 $2
43}
44
45function static_translator_namespaced_stubs() {
46    gen_entries_with_mode static_translator_namespaced_stubs $1 $2
47}
48
49function dispatch_logging_wrappers() {
50    gen_entries_with_mode dispatch_logging_wrappers $1 $2
51}
52
53functions_header $ENTRIES_DIR/render_egl.entries $HEADER_OUT_DIR/RenderEGL_functions.h
54functions_header $ENTRIES_DIR/render_egl_extensions.entries $HEADER_OUT_DIR/RenderEGL_extensions_functions.h
55functions_header $ENTRIES_DIR/render_egl_snapshot.entries $HEADER_OUT_DIR/RenderEGL_snapshot_functions.h
56
57funcargs_header $ENTRIES_DIR/gles1_extensions.entries $HEADER_OUT_DIR/gles1_extensions_functions.h
58funcargs_header $ENTRIES_DIR/gles1_only.entries $HEADER_OUT_DIR/gles1_only_functions.h
59funcargs_header $ENTRIES_DIR/gles2_extensions.entries $HEADER_OUT_DIR/gles2_extensions_functions.h
60funcargs_header $ENTRIES_DIR/gles2_only.entries $HEADER_OUT_DIR/gles2_only_functions.h
61funcargs_header $ENTRIES_DIR/gles31_only.entries $HEADER_OUT_DIR/gles31_only_functions.h
62funcargs_header $ENTRIES_DIR/gles3_extensions.entries $HEADER_OUT_DIR/gles3_extensions_functions.h
63funcargs_header $ENTRIES_DIR/gles3_only.entries $HEADER_OUT_DIR/gles3_only_functions.h
64funcargs_header $ENTRIES_DIR/gles_common.entries $HEADER_OUT_DIR/gles_common_functions.h
65funcargs_header $ENTRIES_DIR/gles_extensions.entries $HEADER_OUT_DIR/gles_extensions_functions.h
66
67static_translator_namespaced_header $ENTRIES_DIR/render_egl.entries $HEADER_OUT_DIR/RenderEGL_static_translator_namespaced_header.h
68static_translator_namespaced_header $ENTRIES_DIR/render_egl_extensions.entries $HEADER_OUT_DIR/RenderEGL_extensions_static_translator_namespaced_header.h
69static_translator_namespaced_header $ENTRIES_DIR/render_egl_snapshot.entries $HEADER_OUT_DIR/RenderEGL_snapshot_static_translator_namespaced_header.h
70static_translator_namespaced_header $ENTRIES_DIR/gles1_extensions.entries $HEADER_OUT_DIR/gles1_extensions_static_translator_namespaced_header.h
71static_translator_namespaced_header $ENTRIES_DIR/gles1_only.entries $HEADER_OUT_DIR/gles1_only_static_translator_namespaced_header.h
72static_translator_namespaced_header $ENTRIES_DIR/gles2_extensions.entries $HEADER_OUT_DIR/gles2_extensions_static_translator_namespaced_header.h
73static_translator_namespaced_header $ENTRIES_DIR/gles2_only.entries $HEADER_OUT_DIR/gles2_only_static_translator_namespaced_header.h
74static_translator_namespaced_header $ENTRIES_DIR/gles31_only.entries $HEADER_OUT_DIR/gles31_only_static_translator_namespaced_header.h
75static_translator_namespaced_header $ENTRIES_DIR/gles3_extensions.entries $HEADER_OUT_DIR/gles3_extensions_static_translator_namespaced_header.h
76static_translator_namespaced_header $ENTRIES_DIR/gles3_only.entries $HEADER_OUT_DIR/gles3_only_static_translator_namespaced_header.h
77static_translator_namespaced_header $ENTRIES_DIR/gles_common_for_gles1.entries $HEADER_OUT_DIR/gles_common_for_gles1_static_translator_namespaced_header.h
78static_translator_namespaced_header $ENTRIES_DIR/gles_common_for_gles2.entries $HEADER_OUT_DIR/gles_common_for_gles2_static_translator_namespaced_header.h
79static_translator_namespaced_header $ENTRIES_DIR/gles_extensions_for_gles1.entries $HEADER_OUT_DIR/gles_extensions_for_gles1_static_translator_namespaced_header.h
80static_translator_namespaced_header $ENTRIES_DIR/gles_extensions_for_gles2.entries $HEADER_OUT_DIR/gles_extensions_for_gles2_static_translator_namespaced_header.h
81
82static_translator_namespaced_stubs $ENTRIES_DIR/gles1_stubbed_in_translator_namespace.entries $IMPL_OUT_DIR/gles1_stubbed_in_translator_namespace.cpp
83static_translator_namespaced_stubs $ENTRIES_DIR/gles2_stubbed_in_translator_namespace.entries $IMPL_OUT_DIR/gles2_stubbed_in_translator_namespace.cpp
84
85dispatch_logging_wrappers $ENTRIES_DIR/gles_common.entries $IMPL_OUT_DIR/gles_common_dispatch_logging_wrappers.impl
86dispatch_logging_wrappers $ENTRIES_DIR/gles_extensions.entries $IMPL_OUT_DIR/gles_extensions_dispatch_logging_wrappers.impl
87dispatch_logging_wrappers $ENTRIES_DIR/gles1_extensions.entries $IMPL_OUT_DIR/gles1_extensions_dispatch_logging_wrappers.impl
88dispatch_logging_wrappers $ENTRIES_DIR/gles1_only.entries $IMPL_OUT_DIR/gles1_only_dispatch_logging_wrappers.impl
89dispatch_logging_wrappers $ENTRIES_DIR/gles2_extensions.entries $IMPL_OUT_DIR/gles2_extensions_dispatch_logging_wrappers.impl
90dispatch_logging_wrappers $ENTRIES_DIR/gles2_only.entries $IMPL_OUT_DIR/gles2_only_dispatch_logging_wrappers.impl
91dispatch_logging_wrappers $ENTRIES_DIR/gles3_extensions.entries $IMPL_OUT_DIR/gles3_extensions_dispatch_logging_wrappers.impl
92dispatch_logging_wrappers $ENTRIES_DIR/gles3_only.entries $IMPL_OUT_DIR/gles3_only_dispatch_logging_wrappers.impl
93dispatch_logging_wrappers $ENTRIES_DIR/gles31_only.entries $IMPL_OUT_DIR/gles31_only_dispatch_logging_wrappers.impl
94dispatch_logging_wrappers $ENTRIES_DIR/gles32_only.entries $IMPL_OUT_DIR/gles32_only_dispatch_logging_wrappers.impl
95