diff options
author | Kristian Høgsberg Kristensen <[email protected]> | 2016-02-15 17:57:03 -0800 |
---|---|---|
committer | Kristian Høgsberg Kristensen <[email protected]> | 2016-02-15 17:57:03 -0800 |
commit | a3672a241b61ed33ebcb5f4114436c9311f748c3 (patch) | |
tree | ac54f08cfe3b9e1e13a1038d4e849561f5695db1 | |
parent | c2b2ebf1ed85b07d2e1ceffca89a7f7833dcb8d1 (diff) |
anv/genxml: Include MBO bits for gen7 and gen75
-rw-r--r-- | src/vulkan/gen7.xml | 3 | ||||
-rw-r--r-- | src/vulkan/gen75.xml | 4 | ||||
-rwxr-xr-x | 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 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="36"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Blend State Pointer" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_CC_STATE_POINTERS" bias="2" length="2"> @@ -886,6 +887,7 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="14"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Color Calc State Pointer" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_CHROMA_KEY" bias="2" length="4"> @@ -1049,6 +1051,7 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="37"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Pointer to DEPTH_STENCIL_STATE" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_DRAWING_RECTANGLE" bias="2" length="4"> 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 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="36"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Blend State Pointer" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_CC_STATE_POINTERS" bias="2" length="2"> @@ -991,6 +992,7 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="14"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Color Calc State Pointer" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_CHROMA_KEY" bias="2" length="4"> @@ -1154,6 +1156,7 @@ <field name="3D Command Sub Opcode" start="16" end="23" type="uint" default="37"/> <field name="DWord Length" start="0" end="7" type="uint" default="0"/> <field name="Pointer to DEPTH_STENCIL_STATE" start="38" end="63" type="offset"/> + <field start="32" end="32" type="mbo"/> </instruction> <instruction name="3DSTATE_DRAWING_RECTANGLE" bias="2" length="4"> @@ -1299,6 +1302,7 @@ <field name="DWord Length" start="0" end="7" type="uint" default="1"/> <field name="Gather Pool Base Address" start="44" end="63" type="address"/> <field name="Gather Pool Enable" start="43" end="43" type="bool"/> + <field start="36" end="37" type="mbo"/> <field name="Memory Object Control State" start="32" end="35" type="MEMORY_OBJECT_CONTROL_STATE"/> <field name="Gather Pool Upper Bound" start="76" end="95" type="address"/> </instruction> 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) |