blob: 36f41ec2e3642231f8fb8057d9ab187c479fe9fe [file] [log] [blame]
Jarkko Pöyry1f99d692014-11-17 14:21:54 -08001# -*- coding: utf-8 -*-
2
Jarkko Pöyry3c77ed42015-01-06 12:54:34 -08003#-------------------------------------------------------------------------
4# drawElements Quality Program utilities
5# --------------------------------------
6#
7# Copyright 2015 The Android Open Source Project
8#
9# Licensed under the Apache License, Version 2.0 (the "License");
10# you may not use this file except in compliance with the License.
11# You may obtain a copy of the License at
12#
13# http://www.apache.org/licenses/LICENSE-2.0
14#
15# Unless required by applicable law or agreed to in writing, software
16# distributed under the License is distributed on an "AS IS" BASIS,
17# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18# See the License for the specific language governing permissions and
19# limitations under the License.
20#
21#-------------------------------------------------------------------------
22
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080023from src_util import *
Jarkko Pöyry7af3c6f2015-02-12 15:27:33 -080024from khr_util.gen_str_util import genSetEnumUtilImpls, genQueryEnumUtilImpls
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080025
26QUERY_NUM_OUT_ARGUMENTS = [
27
28 ("Basic", [
29 ("VIEWPORT", 4),
30 ("DEPTH_RANGE", 2),
31 ("SCISSOR_BOX", 4),
32 ("COLOR_WRITEMASK", 4),
33 ("ALIASED_POINT_SIZE_RANGE", 2),
34 ("ALIASED_LINE_WIDTH_RANGE", 2),
35 ("MAX_VIEWPORT_DIMS", 2),
36 ("MAX_COMPUTE_WORK_GROUP_COUNT", 3),
37 ("MAX_COMPUTE_WORK_GROUP_SIZE", 3),
38 ("PRIMITIVE_BOUNDING_BOX_EXT", 8),
39 ]),
40
Mika Isojärvi78676082015-02-27 14:41:20 -080041 ("Indexed", [
42 ("COLOR_WRITEMASK", 4),
43 ]),
44
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080045 ("Attribute", [
46 ("CURRENT_VERTEX_ATTRIB", 4),
47 ]),
Jarkko Pöyrycb82ed72015-01-26 18:52:33 -080048
49 ("Program", [
50 ("COMPUTE_WORK_GROUP_SIZE", 3),
51 ]),
Jarkko Pöyry7af3c6f2015-02-12 15:27:33 -080052
53 ("TextureParam", [
54 ("TEXTURE_BORDER_COLOR", 4),
55 ]),
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080056]
57
Jarkko Pöyry7af3c6f2015-02-12 15:27:33 -080058SET_NUM_IN_ARGUMENTS = [
59 ("TextureParam", [
60 ("TEXTURE_BORDER_COLOR", 4),
61 ]),
62]
63
64
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080065def addNamePrefix (prefix, groups):
66 return [(groupName, [(prefix + queryName, querySize) for queryName, querySize in groupQueries]) for groupName, groupQueries in groups]
67
68def genQueryUtil (iface):
69 queryNumOutArgs = addNamePrefix("GL_", QUERY_NUM_OUT_ARGUMENTS);
Jarkko Pöyry7af3c6f2015-02-12 15:27:33 -080070 setNumInArgs = addNamePrefix("GL_", SET_NUM_IN_ARGUMENTS);
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080071
Jarkko Pöyry7af3c6f2015-02-12 15:27:33 -080072 utilFile = os.path.join(OPENGL_DIR, "gluQueryUtil.inl")
73 writeInlFile(utilFile, genQueryEnumUtilImpls(iface, queryNumOutArgs))
74
75 utilFile = os.path.join(OPENGL_DIR, "gluCallLogUtil.inl")
76 writeInlFile(utilFile, genSetEnumUtilImpls(iface, setNumInArgs))
Jarkko Pöyry1f99d692014-11-17 14:21:54 -080077
78if __name__ == "__main__":
79 genQueryUtil(getHybridInterface())