mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-12-12 01:55:09 +00:00
pvr: csbgen: Make some loops more pythonic
Signed-off-by: Matt Coster <matt.coster@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>
This commit is contained in:
parent
b813ca5d3b
commit
34a76ec4e6
@ -755,20 +755,19 @@ class Group(object):
|
||||
print(" |\n".join(" " + f for f in non_address_fields) + ";")
|
||||
|
||||
if dw.size == 32:
|
||||
for i in range(address_count):
|
||||
for addr in dw.addresses:
|
||||
print(" dw[%d] = __pvr_address(values->%s, %d, %d, %d) | %s;"
|
||||
% (index, dw.addresses[i].name + field.dim, dw.addresses[i].shift,
|
||||
dw.addresses[i].start - dword_start, dw.addresses[i].end - dword_start, v))
|
||||
% (index, addr.name + field.dim, addr.shift, addr.start - dword_start,
|
||||
addr.end - dword_start, v))
|
||||
continue
|
||||
|
||||
v_accumulated_addr = ""
|
||||
for i in range(address_count):
|
||||
for i, addr in enumerate(dw.addresses):
|
||||
v_address = "v%d_address" % i
|
||||
v_accumulated_addr += "v%d_address" % i
|
||||
print(" const uint64_t %s =" % v_address)
|
||||
print(" __pvr_address(values->%s, %d, %d, %d);"
|
||||
% (dw.addresses[i].name + field.dim, dw.addresses[i].shift,
|
||||
dw.addresses[i].start - dword_start, dw.addresses[i].end - dword_start))
|
||||
% (addr.name + field.dim, addr.shift, addr.start - dword_start, addr.end - dword_start))
|
||||
if i < (address_count - 1):
|
||||
v_accumulated_addr += " |\n "
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user