asahi/genxml: Overflow up to words when packing

So we can pack things that aren't 4-byte sized. Note this doesn't help
with alignment.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18623>
This commit is contained in:
Alyssa Rosenzweig
2022-09-17 11:19:52 -04:00
parent 22d3756207
commit 35d5558fa5
+2 -1
View File
@@ -26,6 +26,7 @@
import xml.parsers.expat
import sys
import operator
import math
from functools import reduce
global_prefix = "agx"
@@ -369,7 +370,7 @@ class Group(object):
elif field.modifier[0] == "log2":
print(" assert(util_is_power_of_two_nonzero(values->{}));".format(field.name))
for index in range(self.length // 4):
for index in range(math.ceil(self.length / 4)):
# Handle MBZ words
if not index in words:
print(" cl[%2d] = 0;" % index)