Home | History | Annotate | Download | only in tnl

Lines Matching refs:vtx

40 static GLboolean match_fastpath( struct tnl_clipspace *vtx,
45 if (vtx->attr_count != fp->attr_count)
48 for (j = 0; j < vtx->attr_count; j++)
49 if (vtx->attr[j].format != fp->attr[j].format ||
50 vtx->attr[j].inputsize != fp->attr[j].size ||
51 vtx->attr[j].vertoffset != fp->attr[j].offset)
55 if (vtx->vertex_size != fp->vertex_size)
58 for (j = 0; j < vtx->attr_count; j++)
59 if (vtx->attr[j].inputstride != fp->attr[j].stride)
66 static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx )
68 struct tnl_clipspace_fastpath *fp = vtx->fastpath;
71 if (match_fastpath(vtx, fp)) {
72 vtx->emit = fp->func;
80 void _tnl_register_fastpath( struct tnl_clipspace *vtx,
86 fastpath->vertex_size = vtx->vertex_size;
87 fastpath->attr_count = vtx->attr_count;
89 fastpath->func = vtx->emit;
91 malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
93 for (i = 0; i < vtx->attr_count; i++) {
94 fastpath->attr[i].format = vtx->attr[i].format;
95 fastpath->attr[i].stride = vtx->attr[i].inputstride;
96 fastpath->attr[i].size = vtx->attr[i].inputsize;
97 fastpath->attr[i].offset = vtx->attr[i].vertoffset;
100 fastpath->next = vtx->fastpath;
101 vtx->fastpath = fastpath;
112 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
113 struct tnl_clipspace_attr *a = vtx->attr;
114 const GLuint attr_count = vtx->attr_count;
124 vtx->emit = NULL;
129 if (search_fastpath_emit(vtx)) {
135 else if (vtx->codegen_emit) {
136 vtx->codegen_emit(ctx);
139 if (!vtx->emit) {
145 if (!vtx->emit)
146 vtx->emit = _tnl_generic_emit;
148 vtx->emit( ctx, count, dest );
158 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
160 if (vtx->need_extras &&
162 vtx->interp = _tnl_generic_interp_extras;
164 vtx->interp = _tnl_generic_interp;
167 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
173 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
175 if (vtx->need_extras &&
177 vtx->copy_pv = _tnl_generic_copy_pv_extras;
179 vtx->copy_pv = _tnl_generic_copy_pv;
182 vtx->copy_pv( ctx, edst, esrc );
198 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
199 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
206 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
207 vtx->copy_pv( ctx, edst, esrc );
218 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
219 const struct tnl_clipspace_attr *a = vtx->attr;
220 const GLuint attr_count = vtx->attr_count;
249 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
250 const struct tnl_clipspace_attr *a = vtx->attr;
251 const GLuint attr_count = vtx->attr_count;
265 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
267 return vtx->vertex_buf + nr * vtx->vertex_size;
274 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
275 vtx->new_inputs = ~0;
276 vtx->interp = choose_interp_func;
277 vtx->copy_pv = choose_copy_pv_func;
281 static void invalidate_funcs( struct tnl_clipspace *vtx )
283 vtx->emit = choose_emit_func;
284 vtx->interp = choose_interp_func;
285 vtx->copy_pv = choose_copy_pv_func;
286 vtx->new_inputs = ~0;
293 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
300 vtx->new_inputs = ~0;
301 vtx->need_viewport = GL_FALSE;
304 vtx->need_viewport = GL_TRUE;
325 if (vtx->attr_count != j ||
326 vtx->attr[j].attrib != map[i].attrib ||
327 vtx->attr[j].format != format ||
328 vtx->attr[j].vertoffset != tmpoffset) {
329 invalidate_funcs(vtx);
331 vtx->attr[j].attrib = map[i].attrib;
332 vtx->attr[j].format = format;
333 vtx->attr[j].vp = vp;
334 vtx->attr[j].insert = _tnl_format_info[format].insert;
335 vtx->attr[j].extract = _tnl_format_info[format].extract;
336 vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
337 vtx->attr[j].vertoffset = tmpoffset;
344 vtx->attr[j].vertoffset);
351 vtx->attr_count = j;
354 vtx->vertex_size = unpacked_size;
356 vtx->vertex_size = offset;
358 assert(vtx->vertex_size <= vtx->max_vertex_size);
359 return vtx->vertex_size;
366 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
367 vtx->new_inputs |= newinputs;
376 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
377 invalidate_funcs(vtx);
384 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
385 struct tnl_clipspace_attr *a = vtx->attr;
386 const GLuint count = vtx->attr_count;
399 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
400 struct tnl_clipspace_attr *a = vtx->attr;
401 const GLuint count = vtx->attr_count;
407 if (vtx->emit != choose_emit_func) {
416 vtx->vp_scale[0] = a->vp[MAT_SX];
417 vtx->vp_scale[1] = a->vp[MAT_SY];
418 vtx->vp_scale[2] = a->vp[MAT_SZ];
419 vtx->vp_scale[3] = 1.0;
420 vtx->vp_xlate[0] = a->vp[MAT_TX];
421 vtx->vp_xlate[1] = a->vp[MAT_TY];
422 vtx->vp_xlate[2] = a->vp[MAT_TZ];
423 vtx->vp_xlate[3] = 0.0;
433 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
435 vtx->emit( ctx, end - start,
436 (GLubyte *)(vtx->vertex_buf +
437 start * vtx->vertex_size));
448 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
453 vtx->emit( ctx, end - start, (GLubyte*) dest );
454 return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
467 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
472 vtx->emit( ctx, 1, cdest );
473 cdest += vtx->vertex_size;
478 vtx->emit( ctx, 1, cdest);
479 cdest += vtx->vertex_size;
490 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
494 vtx->need_extras = GL_TRUE;
495 if (max_vertex_size > vtx->max_vertex_size) {
497 vtx->max_vertex_size = max_vertex_size;
498 vtx->vertex_buf = (GLubyte *)_mesa_align_calloc(vb_size * max_vertex_size, 32 );
499 invalidate_funcs(vtx);
504 vtx->chan_scale[0] = 255.0;
505 vtx->chan_scale[1] = 255.0;
506 vtx->chan_scale[2] = 255.0;
507 vtx->chan_scale[3] = 255.0;
510 vtx->chan_scale[0] = 65535.0;
511 vtx->chan_scale[1] = 65535.0;
512 vtx->chan_scale[2] = 65535.0;
513 vtx->chan_scale[3] = 65535.0;
516 vtx->chan_scale[0] = 1.0;
517 vtx->chan_scale[1] = 1.0;
518 vtx->chan_scale[2] = 1.0;
519 vtx->chan_scale[3] = 1.0;
523 vtx->identity[0] = 0.0;
524 vtx->identity[1] = 0.0;
525 vtx->identity[2] = 0.0;
526 vtx->identity[3] = 1.0;
528 vtx->codegen_emit = NULL;
532 vtx->codegen_emit = _tnl_generate_sse_emit;
541 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
544 if (vtx->vertex_buf) {
545 _mesa_align_free(vtx->vertex_buf);
546 vtx->vertex_buf = NULL;
549 for (fp = vtx->fastpath ; fp ; fp = tmp) {
563 vtx->fastpath = NULL;