zink/codegen: fix type annotations

mypy complains about this

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9021>
This commit is contained in:
Hoe Hao Cheng 2021-02-12 21:50:55 +08:00 committed by Marge Bot
parent 4751135e57
commit 4deb58b9d8

View file

@ -22,10 +22,11 @@
import re
from xml.etree import ElementTree
from typing import List,Tuple
class Version:
device_version : (1,0,0)
struct_version : (1,0)
device_version : Tuple[int, int, int] = (1,0,0)
struct_version : Tuple[int, int] = (1,0)
def __init__(self, version, struct=()):
self.device_version = version
@ -58,20 +59,20 @@ class Version:
+ '_' + struct)
class Extension:
name : str = None
alias : str = None
is_required : bool = False
is_nonstandard : bool = False
enable_conds : [str] = None
name : str = None
alias : str = None
is_required : bool = False
is_nonstandard : bool = False
enable_conds : List[str] = None
# these are specific to zink_device_info.py:
has_properties : bool = False
has_features : bool = False
guard : bool = False
has_properties : bool = False
has_features : bool = False
guard : bool = False
# these are specific to zink_instance.py:
core_since : Version = None
instance_funcs : [str] = None
core_since : Version = None
instance_funcs : List[str] = None
def __init__(self, name, alias="", required=False, nonstandard=False,
properties=False, features=False, conditions=None, guard=False,
@ -146,14 +147,14 @@ Layer = Extension
class ExtensionRegistryEntry:
# type of extension - right now it's either "instance" or "device"
ext_type : str = ""
ext_type : str = ""
# the version in which the extension is promoted to core VK
promoted_in : Version = None
promoted_in : Version = None
# functions added by the extension are referred to as "commands" in the registry
commands : [str] = None
constants : [str] = None
features_struct : str = None
properties_struct : str = None
commands : List[str] = None
constants : List[str] = None
features_struct : str = None
properties_struct : str = None
class ExtensionRegistry:
# key = extension name, value = registry entry