pan/va: Assert no instructions are duplicated

Caught a bug in the published PDF. Whoops!

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12025>
This commit is contained in:
Alyssa Rosenzweig 2021-07-23 17:19:21 -04:00 committed by Marge Bot
parent 02e378b628
commit c43327c049
1 changed files with 10 additions and 0 deletions

View File

@ -360,3 +360,13 @@ for child in root:
build_instr(child)
instruction_dict = { ins.name: ins for ins in instructions }
# Validate there are no duplicated instructions
if len(instruction_dict) != len(instructions):
import collections
counts = collections.Counter([i.name for i in instructions])
for c in counts:
if counts[c] != 1:
print(f'{c} appeared {counts[c]} times.')
assert(len(instruction_dict) == len(instructions))