vulkan: Read len attribute of parameters to functions
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 11 Aug 2021 07:58:08 +0000 (09:58 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 1 Sep 2021 01:05:22 +0000 (01:05 +0000)
It will be needed for generating code that needs to know the size of
arrays.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12369>

src/vulkan/util/vk_dispatch_table_gen.py

index be0bd3c..7eafa8e 100644 (file)
@@ -726,7 +726,7 @@ class StringIntMap(object):
             self.collisions[min(level, 9)] += 1
             self.mapping[h & self.hash_mask] = idx
 
-EntrypointParam = namedtuple('EntrypointParam', 'type name decl')
+EntrypointParam = namedtuple('EntrypointParam', 'type name decl len')
 
 class EntrypointBase(object):
     def __init__(self, name):
@@ -811,7 +811,8 @@ def get_entrypoints(doc, entrypoints_to_defines):
             params = [EntrypointParam(
                 type=p.find('./type').text,
                 name=p.find('./name').text,
-                decl=''.join(p.itertext())
+                decl=''.join(p.itertext()),
+                len=p.attrib.get('len', None)
             ) for p in command.findall('./param')]
             guard = entrypoints_to_defines.get(name)
             # They really need to be unique