From a3672a241b61ed33ebcb5f4114436c9311f748c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Mon, 15 Feb 2016 17:57:03 -0800 Subject: [PATCH] anv/genxml: Include MBO bits for gen7 and gen75 --- src/vulkan/gen7.xml | 3 +++ src/vulkan/gen75.xml | 4 ++++ src/vulkan/gen_pack_header.py | 17 +++++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/vulkan/gen7.xml b/src/vulkan/gen7.xml index d717b144085..8faffcbf876 100644 --- a/src/vulkan/gen7.xml +++ b/src/vulkan/gen7.xml @@ -877,6 +877,7 @@ + @@ -886,6 +887,7 @@ + @@ -1049,6 +1051,7 @@ + diff --git a/src/vulkan/gen75.xml b/src/vulkan/gen75.xml index afdccd0f6a4..c1cbce9fdb6 100644 --- a/src/vulkan/gen75.xml +++ b/src/vulkan/gen75.xml @@ -982,6 +982,7 @@ + @@ -991,6 +992,7 @@ + @@ -1154,6 +1156,7 @@ + @@ -1299,6 +1302,7 @@ + diff --git a/src/vulkan/gen_pack_header.py b/src/vulkan/gen_pack_header.py index fa2eed7a9ab..3cabb5864aa 100755 --- a/src/vulkan/gen_pack_header.py +++ b/src/vulkan/gen_pack_header.py @@ -206,7 +206,8 @@ class Field: def __init__(self, parser, attrs): self.parser = parser - self.name = safe_name(attrs["name"]) + if "name" in attrs: + self.name = safe_name(attrs["name"]) self.start = int(attrs["start"]) self.end = int(attrs["end"]) self.type = attrs["type"] @@ -225,7 +226,7 @@ class Field: if ufixed_match: self.type = 'ufixed' self.fractional_size = int(ufixed_match.group(2)) - + sfixed_match = Field.sfixed_pattern.match(self.type) if sfixed_match: self.type = 'sfixed' @@ -252,9 +253,11 @@ class Field: type = 'uint32_t' elif self.type in self.parser.structs: type = 'struct ' + self.parser.gen_prefix(safe_name(self.type)) + elif self.type == 'mbo': + return else: print("#error unhandled type: %s" % self.type) - + print(" %-36s %s%s;" % (type, self.name, dim)) if len(self.values) > 0 and self.default == None: @@ -398,7 +401,9 @@ class Group: field_index = 0 for field in dw.fields: - name = field.name + field.dim + if field.type != "mbo": + name = field.name + field.dim + if field.type == "mbo": s = "__gen_mbo(%d, %d)" % \ (field.start - dword_start, field.end - dword_start) @@ -537,7 +542,7 @@ class Parser: print("struct %s {" % self.gen_prefix(name)) group.emit_template_struct("") print("};\n") - + def emit_pack_function(self, name, group): name = self.gen_prefix(name) print("static inline void\n%s_pack(__gen_user_data *data, void * restrict dst,\n%sconst struct %s * restrict values)\n{" % @@ -593,7 +598,7 @@ class Parser: name = value.name print('#define %-36s %4d' % (name.upper(), value.value)) print('') - + def parse(self, filename): file = open(filename, "rb") self.parser.ParseFile(file) -- 2.30.2