api_hw_select_init_h.py: simplify the code

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
This commit is contained in:
Marek Olšák 2022-08-11 11:04:13 -04:00 committed by Marge Bot
parent 3c621f8a2a
commit 34356c009c
2 changed files with 5 additions and 8 deletions

View file

@ -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())

View file

@ -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.