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