PV_LAST, PV_LAST,
&pmode, &index_size, &new_count,
&trans_func);
- if (new_count > 0) {
+ if (new_count > 0)
trans_func(original_prims[i].start, new_count, tmp_indices);
- vertex_count = new_count;
- mode = (GLubyte)pmode;
- converted_prim = true;
- }
+ vertex_count = new_count;
+ mode = (GLubyte)pmode;
+ converted_prim = true;
}
/* If 2 consecutive prims use the same mode => merge them. */
merged_prims[last_valid_prim].count = idx - start;
}
merged_prims[last_valid_prim].mode = mode;
- }
- assert(idx > 0 && idx <= max_index_count);
+ /* converted prims will filter incomplete primitives and may have no indices */
+ assert((idx > 0 || converted_prim) && idx <= max_index_count);
+ }
unsigned merged_prim_count = last_valid_prim + 1;
node->cold->ib.ptr = NULL;