Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/native_direct_mesh_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,17 @@ def movv(v,s): return 0x7e000200|(v<<17)|s
run('wrong-count-slot',count_setup+bad_slot+program[3:],'mesh count exchange shape or entry state is not covered')
overflow=count_setup.copy()
overflow[-1]=0x87238315
run('too-many-primitives',overflow+allocate+program[3:],'exceeds declared range')
# Counts above the declared output range are clamped to it (#3537): at most 3 vertices and 1 primitive.
text=run('too-many-primitives',overflow+allocate+program[3:])
clamped={}
for limit in ('3','1'):
compare=re.search(r'(%[\w.]+) = icmp ugt i32 (%[\w.]+), '+limit+r'\n', text)
assert compare, text
chosen=re.search(r'(%[\w.]+) = select i1 '+re.escape(compare[1])+r', i32 '+limit+', i32 '+
re.escape(compare[2])+r'\n', text)
assert chosen, text
clamped[limit]=chosen[1]
assert ('setMeshOutputCounts(i32 168, i32 %s, i32 %s)' % (clamped['3'], clamped['1'])) in text, text

# Write v10 for threads 0..2, then export it after the count exchange.
# v10 is outside the exchange's scratch set but its write is partial.
Expand Down
Loading