Lines Matching refs:split
63 static void flush_vertex( struct split_context *split ) in flush_vertex() argument
65 struct gl_context *ctx = split->ctx; in flush_vertex()
70 if (!split->dstprim_nr) in flush_vertex()
73 if (split->ib) { in flush_vertex()
74 ib = *split->ib; in flush_vertex()
76 ib.count = split->max_index - split->min_index + 1; in flush_vertex()
78 split->min_index * _mesa_sizeof_type(ib.type)); in flush_vertex()
81 for (i = 0; i < split->dstprim_nr; i++) in flush_vertex()
82 split->dstprim[i].start -= split->min_index; in flush_vertex()
85 assert(split->max_index >= split->min_index); in flush_vertex()
87 ctx->Array._DrawArrays = split->array; in flush_vertex()
90 split->draw(ctx, in flush_vertex()
91 split->dstprim, in flush_vertex()
92 split->dstprim_nr, in flush_vertex()
93 split->ib ? &ib : NULL, in flush_vertex()
94 !split->ib, in flush_vertex()
95 split->min_index, in flush_vertex()
96 split->max_index, in flush_vertex()
102 split->dstprim_nr = 0; in flush_vertex()
103 split->min_index = ~0; in flush_vertex()
104 split->max_index = 0; in flush_vertex()
108 static struct _mesa_prim *next_outprim( struct split_context *split ) in next_outprim() argument
110 if (split->dstprim_nr == MAX_PRIM-1) { in next_outprim()
111 flush_vertex(split); in next_outprim()
115 struct _mesa_prim *prim = &split->dstprim[split->dstprim_nr++]; in next_outprim()
121 static void update_index_bounds(struct split_context *split, in update_index_bounds() argument
124 split->min_index = MIN2(split->min_index, prim->start); in update_index_bounds()
125 split->max_index = MAX2(split->max_index, prim->start + prim->count - 1); in update_index_bounds()
132 static GLuint get_max_vertices(struct split_context *split, in get_max_vertices() argument
135 if ((prim->start > split->min_index && in get_max_vertices()
136 prim->start - split->min_index >= split->limit) || in get_max_vertices()
137 (prim->start < split->max_index && in get_max_vertices()
138 split->max_index - prim->start >= split->limit)) in get_max_vertices()
142 return MIN2(split->min_index, prim->start) + split->limit - prim->start; in get_max_vertices()
148 static void split_prims( struct split_context *split) in split_prims() argument
152 for (i = 0; i < split->nr_prims; i++) { in split_prims()
153 const struct _mesa_prim *prim = &split->prim[i]; in split_prims()
156 GLuint available = get_max_vertices(split, prim); in split_prims()
164 flush_vertex(split); in split_prims()
165 available = get_max_vertices(split, prim); in split_prims()
169 struct _mesa_prim *outprim = next_outprim(split); in split_prims()
172 update_index_bounds(split, outprim); in split_prims()
179 struct _mesa_prim *outprim = next_outprim(split); in split_prims()
192 update_index_bounds(split, outprim); in split_prims()
203 flush_vertex(split); in split_prims()
204 available = get_max_vertices(split, prim); in split_prims()
208 else if (split->ib == NULL) { in split_prims()
227 ib.obj = split->ctx->Shared->NullBufferObj; in split_prims()
237 flush_vertex(split); in split_prims()
239 vbo_split_copy(split->ctx, in split_prims()
240 split->array, in split_prims()
243 split->draw, in split_prims()
244 split->limits); in split_prims()
249 flush_vertex(split); in split_prims()
251 vbo_split_copy(split->ctx, in split_prims()
252 split->array, in split_prims()
254 split->ib, in split_prims()
255 split->draw, in split_prims()
256 split->limits); in split_prims()
260 flush_vertex(split); in split_prims()
274 struct split_context split; in vbo_split_inplace() local
276 memset(&split, 0, sizeof(split)); in vbo_split_inplace()
278 split.ctx = ctx; in vbo_split_inplace()
279 split.array = arrays; in vbo_split_inplace()
280 split.prim = prim; in vbo_split_inplace()
281 split.nr_prims = nr_prims; in vbo_split_inplace()
282 split.ib = ib; in vbo_split_inplace()
285 split.min_index = ~0; in vbo_split_inplace()
286 split.max_index = 0; in vbo_split_inplace()
288 split.draw = draw; in vbo_split_inplace()
289 split.limits = limits; in vbo_split_inplace()
290 split.limit = ib ? limits->max_indices : limits->max_verts; in vbo_split_inplace()
292 split_prims( &split ); in vbo_split_inplace()