From dfc0a62994270774554dbc1464d25a6e6f9ebe03 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 22 Jun 2020 20:08:48 +0200 Subject: [PATCH] gallium/indices: use prim_restart-helper for polygon Reviewed-by: Gert Wollny Part-of: --- .../auxiliary/indices/u_indices_gen.py | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/gallium/auxiliary/indices/u_indices_gen.py b/src/gallium/auxiliary/indices/u_indices_gen.py index ea53502f702..d392f5c65bd 100644 --- a/src/gallium/auxiliary/indices/u_indices_gen.py +++ b/src/gallium/auxiliary/indices/u_indices_gen.py @@ -298,28 +298,9 @@ def polygon(intype, outtype, inpv, outpv, pr): preamble(intype, outtype, inpv, outpv, pr, prim='polygon') print(' for (i = start, j = 0; j < out_nr; j+=3, i++) { ') if pr == PRENABLE: - print('restart:') - print(' if (i + 3 > in_nr) {') - print(' (out+j+0)[0] = restart_index;') - print(' (out+j+0)[1] = restart_index;') - print(' (out+j+0)[2] = restart_index;') - print(' continue;') - print(' }') - print(' if (in[i + 0] == restart_index) {') - print(' i += 1;') - print(' start = i;') - print(' goto restart;') - print(' }') - print(' if (in[i + 1] == restart_index) {') - print(' i += 2;') - print(' start = i;') - print(' goto restart;') - print(' }') - print(' if (in[i + 2] == restart_index) {') - print(' i += 3;') - print(' start = i;') - print(' goto restart;') - print(' }') + def close_func(index): + print(' start = i;') + prim_restart(3, 3, 1, close_func) if inpv == FIRST: do_tri( intype, outtype, 'out+j', 'start', 'i+1', 'i+2', inpv, outpv ); -- 2.30.2