1e5c31af7Sopenharmony_ci# -*- coding: utf-8 -*- 2e5c31af7Sopenharmony_ci 3e5c31af7Sopenharmony_ci#------------------------------------------------------------------------- 4e5c31af7Sopenharmony_ci# drawElements Quality Program utilities 5e5c31af7Sopenharmony_ci# -------------------------------------- 6e5c31af7Sopenharmony_ci# 7e5c31af7Sopenharmony_ci# Copyright 2015 The Android Open Source Project 8e5c31af7Sopenharmony_ci# 9e5c31af7Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 10e5c31af7Sopenharmony_ci# you may not use this file except in compliance with the License. 11e5c31af7Sopenharmony_ci# You may obtain a copy of the License at 12e5c31af7Sopenharmony_ci# 13e5c31af7Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 14e5c31af7Sopenharmony_ci# 15e5c31af7Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 16e5c31af7Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 17e5c31af7Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18e5c31af7Sopenharmony_ci# See the License for the specific language governing permissions and 19e5c31af7Sopenharmony_ci# limitations under the License. 20e5c31af7Sopenharmony_ci# 21e5c31af7Sopenharmony_ci#------------------------------------------------------------------------- 22e5c31af7Sopenharmony_ci 23e5c31af7Sopenharmony_cifrom src_util import * 24e5c31af7Sopenharmony_cifrom khr_util.gen_str_util import genSetEnumUtilImpls, genQueryEnumUtilImpls 25e5c31af7Sopenharmony_ci 26e5c31af7Sopenharmony_ciQUERY_NUM_OUT_ARGUMENTS = [ 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ci ("Basic", [ 29e5c31af7Sopenharmony_ci ("VIEWPORT", 4), 30e5c31af7Sopenharmony_ci ("DEPTH_RANGE", 2), 31e5c31af7Sopenharmony_ci ("SCISSOR_BOX", 4), 32e5c31af7Sopenharmony_ci ("COLOR_WRITEMASK", 4), 33e5c31af7Sopenharmony_ci ("ALIASED_POINT_SIZE_RANGE", 2), 34e5c31af7Sopenharmony_ci ("ALIASED_LINE_WIDTH_RANGE", 2), 35e5c31af7Sopenharmony_ci ("MAX_VIEWPORT_DIMS", 2), 36e5c31af7Sopenharmony_ci ("MAX_COMPUTE_WORK_GROUP_COUNT", 3), 37e5c31af7Sopenharmony_ci ("MAX_COMPUTE_WORK_GROUP_SIZE", 3), 38e5c31af7Sopenharmony_ci ("PRIMITIVE_BOUNDING_BOX_EXT", 8), 39e5c31af7Sopenharmony_ci ]), 40e5c31af7Sopenharmony_ci 41e5c31af7Sopenharmony_ci ("Indexed", [ 42e5c31af7Sopenharmony_ci ("COLOR_WRITEMASK", 4), 43e5c31af7Sopenharmony_ci ]), 44e5c31af7Sopenharmony_ci 45e5c31af7Sopenharmony_ci ("Attribute", [ 46e5c31af7Sopenharmony_ci ("CURRENT_VERTEX_ATTRIB", 4), 47e5c31af7Sopenharmony_ci ]), 48e5c31af7Sopenharmony_ci 49e5c31af7Sopenharmony_ci ("Program", [ 50e5c31af7Sopenharmony_ci ("COMPUTE_WORK_GROUP_SIZE", 3), 51e5c31af7Sopenharmony_ci ]), 52e5c31af7Sopenharmony_ci 53e5c31af7Sopenharmony_ci ("TextureParam", [ 54e5c31af7Sopenharmony_ci ("TEXTURE_BORDER_COLOR", 4), 55e5c31af7Sopenharmony_ci ]), 56e5c31af7Sopenharmony_ci] 57e5c31af7Sopenharmony_ci 58e5c31af7Sopenharmony_ciSET_NUM_IN_ARGUMENTS = [ 59e5c31af7Sopenharmony_ci ("TextureParam", [ 60e5c31af7Sopenharmony_ci ("TEXTURE_BORDER_COLOR", 4), 61e5c31af7Sopenharmony_ci ]), 62e5c31af7Sopenharmony_ci] 63e5c31af7Sopenharmony_ci 64e5c31af7Sopenharmony_ci 65e5c31af7Sopenharmony_cidef addNamePrefix (prefix, groups): 66e5c31af7Sopenharmony_ci return [(groupName, [(prefix + queryName, querySize) for queryName, querySize in groupQueries]) for groupName, groupQueries in groups] 67e5c31af7Sopenharmony_ci 68e5c31af7Sopenharmony_cidef genQueryUtil (iface): 69e5c31af7Sopenharmony_ci queryNumOutArgs = addNamePrefix("GL_", QUERY_NUM_OUT_ARGUMENTS); 70e5c31af7Sopenharmony_ci setNumInArgs = addNamePrefix("GL_", SET_NUM_IN_ARGUMENTS); 71e5c31af7Sopenharmony_ci 72e5c31af7Sopenharmony_ci utilFile = os.path.join(OPENGL_DIR, "gluQueryUtil.inl") 73e5c31af7Sopenharmony_ci writeInlFile(utilFile, genQueryEnumUtilImpls(iface, queryNumOutArgs)) 74e5c31af7Sopenharmony_ci 75e5c31af7Sopenharmony_ci utilFile = os.path.join(OPENGL_DIR, "gluCallLogUtil.inl") 76e5c31af7Sopenharmony_ci writeInlFile(utilFile, genSetEnumUtilImpls(iface, setNumInArgs)) 77e5c31af7Sopenharmony_ci 78e5c31af7Sopenharmony_ciif __name__ == "__main__": 79e5c31af7Sopenharmony_ci genQueryUtil(getHybridInterface()) 80