Lines Matching refs:vtx
42 static GLboolean match_fastpath( struct tnl_clipspace *vtx,
47 if (vtx->attr_count != fp->attr_count)
50 for (j = 0; j < vtx->attr_count; j++)
51 if (vtx->attr[j].format != fp->attr[j].format ||
52 vtx->attr[j].inputsize != fp->attr[j].size ||
53 vtx->attr[j].vertoffset != fp->attr[j].offset)
57 if (vtx->vertex_size != fp->vertex_size)
60 for (j = 0; j < vtx->attr_count; j++)
61 if (vtx->attr[j].inputstride != fp->attr[j].stride)
68 static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx )
70 struct tnl_clipspace_fastpath *fp = vtx->fastpath;
73 if (match_fastpath(vtx, fp)) {
74 vtx->emit = fp->func;
82 void _tnl_register_fastpath( struct tnl_clipspace *vtx,
93 fastpath->vertex_size = vtx->vertex_size;
94 fastpath->attr_count = vtx->attr_count;
96 fastpath->func = vtx->emit;
97 fastpath->attr = malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
105 for (i = 0; i < vtx->attr_count; i++) {
106 fastpath->attr[i].format = vtx->attr[i].format;
107 fastpath->attr[i].stride = vtx->attr[i].inputstride;
108 fastpath->attr[i].size = vtx->attr[i].inputsize;
109 fastpath->attr[i].offset = vtx->attr[i].vertoffset;
112 fastpath->next = vtx->fastpath;
113 vtx->fastpath = fastpath;
124 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
125 struct tnl_clipspace_attr *a = vtx->attr;
126 const GLuint attr_count = vtx->attr_count;
136 vtx->emit = NULL;
141 if (search_fastpath_emit(vtx)) {
147 else if (vtx->codegen_emit) {
148 vtx->codegen_emit(ctx);
151 if (!vtx->emit) {
157 if (!vtx->emit)
158 vtx->emit = _tnl_generic_emit;
160 vtx->emit( ctx, count, dest );
170 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
175 if (vtx->need_extras && (twosided || unfilled)) {
176 vtx->interp = _tnl_generic_interp_extras;
178 vtx->interp = _tnl_generic_interp;
181 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
187 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
193 if (vtx->need_extras && (twosided || unfilled)) {
194 vtx->copy_pv = _tnl_generic_copy_pv_extras;
196 vtx->copy_pv = _tnl_generic_copy_pv;
199 vtx->copy_pv( ctx, edst, esrc );
215 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
216 vtx->interp( ctx, t, edst, eout, ein, force_boundary );
223 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
224 vtx->copy_pv( ctx, edst, esrc );
235 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
236 const struct tnl_clipspace_attr *a = vtx->attr;
237 const GLuint attr_count = vtx->attr_count;
266 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
267 const struct tnl_clipspace_attr *a = vtx->attr;
268 const GLuint attr_count = vtx->attr_count;
282 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
284 return vtx->vertex_buf + nr * vtx->vertex_size;
291 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
292 vtx->new_inputs = ~0;
293 vtx->interp = choose_interp_func;
294 vtx->copy_pv = choose_copy_pv_func;
298 static void invalidate_funcs( struct tnl_clipspace *vtx )
300 vtx->emit = choose_emit_func;
301 vtx->interp = choose_interp_func;
302 vtx->copy_pv = choose_copy_pv_func;
303 vtx->new_inputs = ~0;
310 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
317 vtx->new_inputs = ~0;
318 vtx->need_viewport = GL_FALSE;
321 vtx->need_viewport = GL_TRUE;
342 if (vtx->attr_count != j ||
343 vtx->attr[j].attrib != map[i].attrib ||
344 vtx->attr[j].format != format ||
345 vtx->attr[j].vertoffset != tmpoffset) {
346 invalidate_funcs(vtx);
348 vtx->attr[j].attrib = map[i].attrib;
349 vtx->attr[j].format = format;
350 vtx->attr[j].vp = vp;
351 vtx->attr[j].insert = _tnl_format_info[format].insert;
352 vtx->attr[j].extract = _tnl_format_info[format].extract;
353 vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
354 vtx->attr[j].vertoffset = tmpoffset;
361 vtx->attr[j].vertoffset);
368 vtx->attr_count = j;
371 vtx->vertex_size = unpacked_size;
373 vtx->vertex_size = offset;
375 assert(vtx->vertex_size <= vtx->max_vertex_size);
376 return vtx->vertex_size;
383 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
384 vtx->new_inputs |= newinputs;
393 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
394 invalidate_funcs(vtx);
401 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
402 struct tnl_clipspace_attr *a = vtx->attr;
403 const GLuint count = vtx->attr_count;
416 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
417 struct tnl_clipspace_attr *a = vtx->attr;
418 const GLuint count = vtx->attr_count;
424 if (vtx->emit != choose_emit_func) {
433 vtx->vp_scale[0] = a->vp[MAT_SX];
434 vtx->vp_scale[1] = a->vp[MAT_SY];
435 vtx->vp_scale[2] = a->vp[MAT_SZ];
436 vtx->vp_scale[3] = 1.0;
437 vtx->vp_xlate[0] = a->vp[MAT_TX];
438 vtx->vp_xlate[1] = a->vp[MAT_TY];
439 vtx->vp_xlate[2] = a->vp[MAT_TZ];
440 vtx->vp_xlate[3] = 0.0;
450 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
452 vtx->emit( ctx, end - start,
453 (GLubyte *)(vtx->vertex_buf +
454 start * vtx->vertex_size));
465 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
470 vtx->emit( ctx, end - start, (GLubyte*) dest );
471 return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
484 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
489 vtx->emit( ctx, 1, cdest );
490 cdest += vtx->vertex_size;
495 vtx->emit( ctx, 1, cdest);
496 cdest += vtx->vertex_size;
507 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
511 vtx->need_extras = GL_TRUE;
512 if (max_vertex_size > vtx->max_vertex_size) {
514 vtx->max_vertex_size = max_vertex_size;
515 vtx->vertex_buf = align_calloc(vb_size * max_vertex_size, 32 );
516 invalidate_funcs(vtx);
521 vtx->chan_scale[0] = 255.0;
522 vtx->chan_scale[1] = 255.0;
523 vtx->chan_scale[2] = 255.0;
524 vtx->chan_scale[3] = 255.0;
527 vtx->chan_scale[0] = 65535.0;
528 vtx->chan_scale[1] = 65535.0;
529 vtx->chan_scale[2] = 65535.0;
530 vtx->chan_scale[3] = 65535.0;
533 vtx->chan_scale[0] = 1.0;
534 vtx->chan_scale[1] = 1.0;
535 vtx->chan_scale[2] = 1.0;
536 vtx->chan_scale[3] = 1.0;
540 vtx->identity[0] = 0.0;
541 vtx->identity[1] = 0.0;
542 vtx->identity[2] = 0.0;
543 vtx->identity[3] = 1.0;
545 vtx->codegen_emit = NULL;
549 vtx->codegen_emit = _tnl_generate_sse_emit;
558 struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
561 align_free(vtx->vertex_buf);
562 vtx->vertex_buf = NULL;
564 for (fp = vtx->fastpath ; fp ; fp = tmp) {
578 vtx->fastpath = NULL;