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,
91 fastpath->vertex_size = vtx->vertex_size;
92 fastpath->attr_count = vtx->attr_count;
94 fastpath->func = vtx->emit;
95 fastpath->attr = malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
103 for (i = 0; i < vtx->attr_count; i++) {
104 fastpath->attr[i].format = vtx->attr[i].format;
105 fastpath->attr[i].stride = vtx->attr[i].inputstride;
106 fastpath->attr[i].size = vtx->attr[i].inputsize;
107 fastpath->attr[i].offset = vtx->attr[i].vertoffset;
110 fastpath->next = vtx->fastpath;
111 vtx->fastpath = fastpath;
122 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
123 struct tnl_clipspace_attr *a = vtx->attr;
124 const GLuint attr_count = vtx->attr_count;
134 vtx->emit = NULL;
139 if (search_fastpath_emit(vtx)) {
145 else if (vtx->codegen_emit) {
146 vtx->codegen_emit(ctx);
149 if (!vtx->emit) {
155 if (!vtx->emit)
156 vtx->emit = _tnl_generic_emit;
158 vtx->emit( ctx, count, dest );
168 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
173 if (vtx->need_extras && (twosided || unfilled)) {
174 vtx->interp = _tnl_generic_interp_extras;
176 vtx->interp = _tnl_generic_interp;
179 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
185 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
191 if (vtx->need_extras && (twosided || unfilled)) {
192 vtx->copy_pv = _tnl_generic_copy_pv_extras;
194 vtx->copy_pv = _tnl_generic_copy_pv;
197 vtx->copy_pv( ctx, edst, esrc );
213 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
214 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
221 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
222 vtx->copy_pv( ctx, edst, esrc );
233 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
234 const struct tnl_clipspace_attr *a = vtx->attr;
235 const GLuint attr_count = vtx->attr_count;
264 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
265 const struct tnl_clipspace_attr *a = vtx->attr;
266 const GLuint attr_count = vtx->attr_count;
280 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
282 return vtx->vertex_buf + nr * vtx->vertex_size;
289 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
290 vtx->new_inputs = ~0;
291 vtx->interp = choose_interp_func;
292 vtx->copy_pv = choose_copy_pv_func;
296 static void invalidate_funcs( struct tnl_clipspace *vtx )
298 vtx->emit = choose_emit_func;
299 vtx->interp = choose_interp_func;
300 vtx->copy_pv = choose_copy_pv_func;
301 vtx->new_inputs = ~0;
308 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
315 vtx->new_inputs = ~0;
316 vtx->need_viewport = GL_FALSE;
319 vtx->need_viewport = GL_TRUE;
340 if (vtx->attr_count != j ||
341 vtx->attr[j].attrib != map[i].attrib ||
342 vtx->attr[j].format != format ||
343 vtx->attr[j].vertoffset != tmpoffset) {
344 invalidate_funcs(vtx);
346 vtx->attr[j].attrib = map[i].attrib;
347 vtx->attr[j].format = format;
348 vtx->attr[j].vp = vp;
349 vtx->attr[j].insert = _tnl_format_info[format].insert;
350 vtx->attr[j].extract = _tnl_format_info[format].extract;
351 vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
352 vtx->attr[j].vertoffset = tmpoffset;
359 vtx->attr[j].vertoffset);
366 vtx->attr_count = j;
369 vtx->vertex_size = unpacked_size;
371 vtx->vertex_size = offset;
373 assert(vtx->vertex_size <= vtx->max_vertex_size);
374 return vtx->vertex_size;
381 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
382 vtx->new_inputs |= newinputs;
391 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
392 invalidate_funcs(vtx);
399 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
400 struct tnl_clipspace_attr *a = vtx->attr;
401 const GLuint count = vtx->attr_count;
414 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
415 struct tnl_clipspace_attr *a = vtx->attr;
416 const GLuint count = vtx->attr_count;
422 if (vtx->emit != choose_emit_func) {
431 vtx->vp_scale[0] = a->vp[MAT_SX];
432 vtx->vp_scale[1] = a->vp[MAT_SY];
433 vtx->vp_scale[2] = a->vp[MAT_SZ];
434 vtx->vp_scale[3] = 1.0;
435 vtx->vp_xlate[0] = a->vp[MAT_TX];
436 vtx->vp_xlate[1] = a->vp[MAT_TY];
437 vtx->vp_xlate[2] = a->vp[MAT_TZ];
438 vtx->vp_xlate[3] = 0.0;
448 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
450 vtx->emit( ctx, end - start,
451 (GLubyte *)(vtx->vertex_buf +
452 start * vtx->vertex_size));
463 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
468 vtx->emit( ctx, end - start, (GLubyte*) dest );
469 return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
482 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
487 vtx->emit( ctx, 1, cdest );
488 cdest += vtx->vertex_size;
493 vtx->emit( ctx, 1, cdest);
494 cdest += vtx->vertex_size;
505 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
509 vtx->need_extras = GL_TRUE;
510 if (max_vertex_size > vtx->max_vertex_size) {
512 vtx->max_vertex_size = max_vertex_size;
513 vtx->vertex_buf = _mesa_align_calloc(vb_size * max_vertex_size, 32 );
514 invalidate_funcs(vtx);
519 vtx->chan_scale[0] = 255.0;
520 vtx->chan_scale[1] = 255.0;
521 vtx->chan_scale[2] = 255.0;
522 vtx->chan_scale[3] = 255.0;
525 vtx->chan_scale[0] = 65535.0;
526 vtx->chan_scale[1] = 65535.0;
527 vtx->chan_scale[2] = 65535.0;
528 vtx->chan_scale[3] = 65535.0;
531 vtx->chan_scale[0] = 1.0;
532 vtx->chan_scale[1] = 1.0;
533 vtx->chan_scale[2] = 1.0;
534 vtx->chan_scale[3] = 1.0;
538 vtx->identity[0] = 0.0;
539 vtx->identity[1] = 0.0;
540 vtx->identity[2] = 0.0;
541 vtx->identity[3] = 1.0;
543 vtx->codegen_emit = NULL;
547 vtx->codegen_emit = _tnl_generate_sse_emit;
556 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
559 _mesa_align_free(vtx->vertex_buf);
560 vtx->vertex_buf = NULL;
562 for (fp = vtx->fastpath ; fp ; fp = tmp) {
576 vtx->fastpath = NULL;