Lines Matching refs:tg

608 static ALWAYS_INLINE void PIPE_CDECL generic_run_one( struct translate_generic *tg,  in generic_run_one()  argument
613 unsigned nr_attrs = tg->nr_attrib; in generic_run_one()
618 uint8_t *dst = (uint8_t *)vert + tg->attrib[attr].output_offset; in generic_run_one()
620 if (tg->attrib[attr].type == TRANSLATE_ELEMENT_NORMAL) { in generic_run_one()
625 if (tg->attrib[attr].instance_divisor) { in generic_run_one()
626 index = instance_id / tg->attrib[attr].instance_divisor; in generic_run_one()
635 index = MIN2(index, tg->attrib[attr].max_index); in generic_run_one()
638 src = tg->attrib[attr].input_ptr + in generic_run_one()
639 tg->attrib[attr].input_stride * index; in generic_run_one()
641 copy_size = tg->attrib[attr].copy_size; in generic_run_one()
646 tg->attrib[attr].fetch( data, src, 0, 0 ); in generic_run_one()
652 tg->attrib[attr].input_ptr, in generic_run_one()
653 tg->attrib[attr].input_stride, in generic_run_one()
657 tg->attrib[attr].emit( data, dst ); in generic_run_one()
660 if(likely(tg->attrib[attr].copy_size >= 0)) in generic_run_one()
665 tg->attrib[attr].emit( data, dst ); in generic_run_one()
680 struct translate_generic *tg = translate_generic(translate); in generic_run_elts() local
685 generic_run_one(tg, *elts++, instance_id, vert); in generic_run_elts()
686 vert += tg->translate.key.output_stride; in generic_run_elts()
696 struct translate_generic *tg = translate_generic(translate); in generic_run_elts16() local
701 generic_run_one(tg, *elts++, instance_id, vert); in generic_run_elts16()
702 vert += tg->translate.key.output_stride; in generic_run_elts16()
712 struct translate_generic *tg = translate_generic(translate); in generic_run_elts8() local
717 generic_run_one(tg, *elts++, instance_id, vert); in generic_run_elts8()
718 vert += tg->translate.key.output_stride; in generic_run_elts8()
728 struct translate_generic *tg = translate_generic(translate); in generic_run() local
733 generic_run_one(tg, start + i, instance_id, vert); in generic_run()
734 vert += tg->translate.key.output_stride; in generic_run()
746 struct translate_generic *tg = translate_generic(translate); in generic_set_buffer() local
749 for (i = 0; i < tg->nr_attrib; i++) { in generic_set_buffer()
750 if (tg->attrib[i].buffer == buf) { in generic_set_buffer()
751 tg->attrib[i].input_ptr = ((const uint8_t *)ptr + in generic_set_buffer()
752 tg->attrib[i].input_offset); in generic_set_buffer()
753 tg->attrib[i].input_stride = stride; in generic_set_buffer()
754 tg->attrib[i].max_index = max_index; in generic_set_buffer()
790 struct translate_generic *tg = CALLOC_STRUCT(translate_generic); in translate_generic_create() local
793 if (tg == NULL) in translate_generic_create()
796 tg->translate.key = *key; in translate_generic_create()
797 tg->translate.release = generic_release; in translate_generic_create()
798 tg->translate.set_buffer = generic_set_buffer; in translate_generic_create()
799 tg->translate.run_elts = generic_run_elts; in translate_generic_create()
800 tg->translate.run_elts16 = generic_run_elts16; in translate_generic_create()
801 tg->translate.run_elts8 = generic_run_elts8; in translate_generic_create()
802 tg->translate.run = generic_run; in translate_generic_create()
811 tg->attrib[i].type = key->element[i].type; in translate_generic_create()
818 FREE(tg); in translate_generic_create()
823 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_sint; in translate_generic_create()
825 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_uint; in translate_generic_create()
828 tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_float; in translate_generic_create()
831 tg->attrib[i].buffer = key->element[i].input_buffer; in translate_generic_create()
832 tg->attrib[i].input_offset = key->element[i].input_offset; in translate_generic_create()
833 tg->attrib[i].instance_divisor = key->element[i].instance_divisor; in translate_generic_create()
835 tg->attrib[i].output_offset = key->element[i].output_offset; in translate_generic_create()
837 tg->attrib[i].copy_size = -1; in translate_generic_create()
838 if (tg->attrib[i].type == TRANSLATE_ELEMENT_INSTANCE_ID) in translate_generic_create()
842 tg->attrib[i].copy_size = 4; in translate_generic_create()
850 tg->attrib[i].copy_size = format_desc->block.bits >> 3; in translate_generic_create()
853 if(tg->attrib[i].copy_size < 0) in translate_generic_create()
854 tg->attrib[i].emit = get_emit_func(key->element[i].output_format); in translate_generic_create()
856 tg->attrib[i].emit = NULL; in translate_generic_create()
859 tg->nr_attrib = key->nr_elements; in translate_generic_create()
862 return &tg->translate; in translate_generic_create()