Lines Matching refs:tg
584 static ALWAYS_INLINE void PIPE_CDECL generic_run_one( struct translate_generic *tg, in generic_run_one() argument
590 unsigned nr_attrs = tg->nr_attrib; in generic_run_one()
595 uint8_t *dst = (uint8_t *)vert + tg->attrib[attr].output_offset; in generic_run_one()
597 if (tg->attrib[attr].type == TRANSLATE_ELEMENT_NORMAL) { in generic_run_one()
602 if (tg->attrib[attr].instance_divisor) { in generic_run_one()
604 index += (instance_id / tg->attrib[attr].instance_divisor); in generic_run_one()
613 index = MIN2(index, tg->attrib[attr].max_index); in generic_run_one()
616 src = tg->attrib[attr].input_ptr + in generic_run_one()
617 (ptrdiff_t)tg->attrib[attr].input_stride * index; in generic_run_one()
619 copy_size = tg->attrib[attr].copy_size; in generic_run_one()
624 tg->attrib[attr].fetch( data, src, 0, 0 ); in generic_run_one()
630 tg->attrib[attr].input_ptr, in generic_run_one()
631 tg->attrib[attr].input_stride, in generic_run_one()
635 tg->attrib[attr].emit( data, dst ); in generic_run_one()
638 if(likely(tg->attrib[attr].copy_size >= 0)) in generic_run_one()
643 tg->attrib[attr].emit( data, dst ); in generic_run_one()
659 struct translate_generic *tg = translate_generic(translate); in generic_run_elts() local
664 generic_run_one(tg, *elts++, start_instance, instance_id, vert); in generic_run_elts()
665 vert += tg->translate.key.output_stride; in generic_run_elts()
676 struct translate_generic *tg = translate_generic(translate); in generic_run_elts16() local
681 generic_run_one(tg, *elts++, start_instance, instance_id, vert); in generic_run_elts16()
682 vert += tg->translate.key.output_stride; in generic_run_elts16()
693 struct translate_generic *tg = translate_generic(translate); in generic_run_elts8() local
698 generic_run_one(tg, *elts++, start_instance, instance_id, vert); in generic_run_elts8()
699 vert += tg->translate.key.output_stride; in generic_run_elts8()
710 struct translate_generic *tg = translate_generic(translate); in generic_run() local
715 generic_run_one(tg, start + i, start_instance, instance_id, vert); in generic_run()
716 vert += tg->translate.key.output_stride; in generic_run()
728 struct translate_generic *tg = translate_generic(translate); in generic_set_buffer() local
731 for (i = 0; i < tg->nr_attrib; i++) { in generic_set_buffer()
732 if (tg->attrib[i].buffer == buf) { in generic_set_buffer()
733 tg->attrib[i].input_ptr = ((const uint8_t *)ptr + in generic_set_buffer()
734 tg->attrib[i].input_offset); in generic_set_buffer()
735 tg->attrib[i].input_stride = stride; in generic_set_buffer()
736 tg->attrib[i].max_index = max_index; in generic_set_buffer()
772 struct translate_generic *tg = CALLOC_STRUCT(translate_generic); in translate_generic_create() local
775 if (!tg) in translate_generic_create()
780 tg->translate.key = *key; in translate_generic_create()
781 tg->translate.release = generic_release; in translate_generic_create()
782 tg->translate.set_buffer = generic_set_buffer; in translate_generic_create()
783 tg->translate.run_elts = generic_run_elts; in translate_generic_create()
784 tg->translate.run_elts16 = generic_run_elts16; in translate_generic_create()
785 tg->translate.run_elts8 = generic_run_elts8; in translate_generic_create()
786 tg->translate.run = generic_run; in translate_generic_create()
794 tg->attrib[i].type = key->element[i].type; in translate_generic_create()
801 FREE(tg); in translate_generic_create()
807 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_sint; in translate_generic_create()
810 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_uint; in translate_generic_create()
814 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_float; in translate_generic_create()
817 tg->attrib[i].buffer = key->element[i].input_buffer; in translate_generic_create()
818 tg->attrib[i].input_offset = key->element[i].input_offset; in translate_generic_create()
819 tg->attrib[i].instance_divisor = key->element[i].instance_divisor; in translate_generic_create()
821 tg->attrib[i].output_offset = key->element[i].output_offset; in translate_generic_create()
823 tg->attrib[i].copy_size = -1; in translate_generic_create()
824 if (tg->attrib[i].type == TRANSLATE_ELEMENT_INSTANCE_ID) in translate_generic_create()
828 tg->attrib[i].copy_size = 4; in translate_generic_create()
836 tg->attrib[i].copy_size = format_desc->block.bits >> 3; in translate_generic_create()
839 if(tg->attrib[i].copy_size < 0) in translate_generic_create()
840 tg->attrib[i].emit = get_emit_func(key->element[i].output_format); in translate_generic_create()
842 tg->attrib[i].emit = NULL; in translate_generic_create()
845 tg->nr_attrib = key->nr_elements; in translate_generic_create()
848 return &tg->translate; in translate_generic_create()