Lines Matching refs:vtx

41 static GLboolean match_fastpath( struct tnl_clipspace *vtx,
46 if (vtx->attr_count != fp->attr_count)
49 for (j = 0; j < vtx->attr_count; j++)
50 if (vtx->attr[j].format != fp->attr[j].format ||
51 vtx->attr[j].inputsize != fp->attr[j].size ||
52 vtx->attr[j].vertoffset != fp->attr[j].offset)
56 if (vtx->vertex_size != fp->vertex_size)
59 for (j = 0; j < vtx->attr_count; j++)
60 if (vtx->attr[j].inputstride != fp->attr[j].stride)
67 static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx )
69 struct tnl_clipspace_fastpath *fp = vtx->fastpath;
72 if (match_fastpath(vtx, fp)) {
73 vtx->emit = fp->func;
81 void _tnl_register_fastpath( struct tnl_clipspace *vtx,
92 fastpath->vertex_size = vtx->vertex_size;
93 fastpath->attr_count = vtx->attr_count;
95 fastpath->func = vtx->emit;
96 fastpath->attr = malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
104 for (i = 0; i < vtx->attr_count; i++) {
105 fastpath->attr[i].format = vtx->attr[i].format;
106 fastpath->attr[i].stride = vtx->attr[i].inputstride;
107 fastpath->attr[i].size = vtx->attr[i].inputsize;
108 fastpath->attr[i].offset = vtx->attr[i].vertoffset;
111 fastpath->next = vtx->fastpath;
112 vtx->fastpath = fastpath;
123 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
124 struct tnl_clipspace_attr *a = vtx->attr;
125 const GLuint attr_count = vtx->attr_count;
135 vtx->emit = NULL;
140 if (search_fastpath_emit(vtx)) {
146 else if (vtx->codegen_emit) {
147 vtx->codegen_emit(ctx);
150 if (!vtx->emit) {
156 if (!vtx->emit)
157 vtx->emit = _tnl_generic_emit;
159 vtx->emit( ctx, count, dest );
169 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
174 if (vtx->need_extras && (twosided || unfilled)) {
175 vtx->interp = _tnl_generic_interp_extras;
177 vtx->interp = _tnl_generic_interp;
180 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
186 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
192 if (vtx->need_extras && (twosided || unfilled)) {
193 vtx->copy_pv = _tnl_generic_copy_pv_extras;
195 vtx->copy_pv = _tnl_generic_copy_pv;
198 vtx->copy_pv( ctx, edst, esrc );
214 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
215 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
222 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
223 vtx->copy_pv( ctx, edst, esrc );
234 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
235 const struct tnl_clipspace_attr *a = vtx->attr;
236 const GLuint attr_count = vtx->attr_count;
265 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
266 const struct tnl_clipspace_attr *a = vtx->attr;
267 const GLuint attr_count = vtx->attr_count;
281 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
283 return vtx->vertex_buf + nr * vtx->vertex_size;
290 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
291 vtx->new_inputs = ~0;
292 vtx->interp = choose_interp_func;
293 vtx->copy_pv = choose_copy_pv_func;
297 static void invalidate_funcs( struct tnl_clipspace *vtx )
299 vtx->emit = choose_emit_func;
300 vtx->interp = choose_interp_func;
301 vtx->copy_pv = choose_copy_pv_func;
302 vtx->new_inputs = ~0;
309 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
316 vtx->new_inputs = ~0;
317 vtx->need_viewport = GL_FALSE;
320 vtx->need_viewport = GL_TRUE;
341 if (vtx->attr_count != j ||
342 vtx->attr[j].attrib != map[i].attrib ||
343 vtx->attr[j].format != format ||
344 vtx->attr[j].vertoffset != tmpoffset) {
345 invalidate_funcs(vtx);
347 vtx->attr[j].attrib = map[i].attrib;
348 vtx->attr[j].format = format;
349 vtx->attr[j].vp = vp;
350 vtx->attr[j].insert = _tnl_format_info[format].insert;
351 vtx->attr[j].extract = _tnl_format_info[format].extract;
352 vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
353 vtx->attr[j].vertoffset = tmpoffset;
360 vtx->attr[j].vertoffset);
367 vtx->attr_count = j;
370 vtx->vertex_size = unpacked_size;
372 vtx->vertex_size = offset;
374 assert(vtx->vertex_size <= vtx->max_vertex_size);
375 return vtx->vertex_size;
382 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
383 vtx->new_inputs |= newinputs;
392 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
393 invalidate_funcs(vtx);
400 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
401 struct tnl_clipspace_attr *a = vtx->attr;
402 const GLuint count = vtx->attr_count;
415 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
416 struct tnl_clipspace_attr *a = vtx->attr;
417 const GLuint count = vtx->attr_count;
423 if (vtx->emit != choose_emit_func) {
432 vtx->vp_scale[0] = a->vp[MAT_SX];
433 vtx->vp_scale[1] = a->vp[MAT_SY];
434 vtx->vp_scale[2] = a->vp[MAT_SZ];
435 vtx->vp_scale[3] = 1.0;
436 vtx->vp_xlate[0] = a->vp[MAT_TX];
437 vtx->vp_xlate[1] = a->vp[MAT_TY];
438 vtx->vp_xlate[2] = a->vp[MAT_TZ];
439 vtx->vp_xlate[3] = 0.0;
449 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
451 vtx->emit( ctx, end - start,
452 (GLubyte *)(vtx->vertex_buf +
453 start * vtx->vertex_size));
464 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
469 vtx->emit( ctx, end - start, (GLubyte*) dest );
470 return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
483 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
488 vtx->emit( ctx, 1, cdest );
489 cdest += vtx->vertex_size;
494 vtx->emit( ctx, 1, cdest);
495 cdest += vtx->vertex_size;
506 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
510 vtx->need_extras = GL_TRUE;
511 if (max_vertex_size > vtx->max_vertex_size) {
513 vtx->max_vertex_size = max_vertex_size;
514 vtx->vertex_buf = _mesa_align_calloc(vb_size * max_vertex_size, 32 );
515 invalidate_funcs(vtx);
520 vtx->chan_scale[0] = 255.0;
521 vtx->chan_scale[1] = 255.0;
522 vtx->chan_scale[2] = 255.0;
523 vtx->chan_scale[3] = 255.0;
526 vtx->chan_scale[0] = 65535.0;
527 vtx->chan_scale[1] = 65535.0;
528 vtx->chan_scale[2] = 65535.0;
529 vtx->chan_scale[3] = 65535.0;
532 vtx->chan_scale[0] = 1.0;
533 vtx->chan_scale[1] = 1.0;
534 vtx->chan_scale[2] = 1.0;
535 vtx->chan_scale[3] = 1.0;
539 vtx->identity[0] = 0.0;
540 vtx->identity[1] = 0.0;
541 vtx->identity[2] = 0.0;
542 vtx->identity[3] = 1.0;
544 vtx->codegen_emit = NULL;
548 vtx->codegen_emit = _tnl_generate_sse_emit;
557 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
560 _mesa_align_free(vtx->vertex_buf);
561 vtx->vertex_buf = NULL;
563 for (fp = vtx->fastpath ; fp ; fp = tmp) {
577 vtx->fastpath = NULL;