From: Marek Olšák Date: Thu, 11 Aug 2022 15:04:13 +0000 (-0400) Subject: api_hw_select_init_h.py: simplify the code X-Git-Tag: upstream/22.3.5~2316 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=34356c009c12d25518a3208e55638282ecb21e4c;p=platform%2Fupstream%2Fmesa.git api_hw_select_init_h.py: simplify the code Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- diff --git a/src/mapi/glapi/gen/api_hw_select_init_h.py b/src/mapi/glapi/gen/api_hw_select_init_h.py index 8d2e851..666580f 100644 --- a/src/mapi/glapi/gen/api_hw_select_init_h.py +++ b/src/mapi/glapi/gen/api_hw_select_init_h.py @@ -22,13 +22,9 @@ # This script generates the file api_hw_select_init.h. -import argparse -import collections import license import gl_XML -import sys import apiexec -import re class PrintCode(gl_XML.gl_print_base): @@ -43,11 +39,9 @@ class PrintCode(gl_XML.gl_print_base): def printBody(self, api): for f in api.functionIterateAll(): - if f.exec_flavor != 'beginend': - continue - - if (re.match('Vertex*', f.name)): + if f.has_hw_select_variant: print('SET_{0}(tab, NAME({0}));'.format(f.name)) + if __name__ == '__main__': apiexec.print_glapi_file(PrintCode()) diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index cafe087..d9e4d09 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -615,6 +615,7 @@ class gl_function( gl_item ): self.initialized = 0 self.images = [] self.exec_flavor = 'mesa' + self.has_hw_select_variant = False self.desktop = True self.deprecated = None self.has_no_error_variant = False @@ -693,6 +694,8 @@ class gl_function( gl_item ): else: true_name = name + self.has_hw_select_variant = exec_flavor == 'beginend' and name[0:6] == 'Vertex' + # Only try to set the offset when a non-alias entry-point # is being processed.