translate.h File Reference

Include dependency graph for translate.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  translate_element
 Vertex fetch/store/convert code. More...
struct  translate_key
struct  translate

Functions

struct translatetranslate_create (const struct translate_key *key)
static int translate_keysize (const struct translate_key *key)
static int translate_key_compare (const struct translate_key *a, const struct translate_key *b)
static void translate_key_sanitize (struct translate_key *a)
struct translatetranslate_sse2_create (const struct translate_key *key)
struct translatetranslate_generic_create (const struct translate_key *key)


Function Documentation

struct translate* translate_create ( const struct translate_key key  )  [read]

Definition at line 37 of file translate.c.

References translate_generic_create(), and translate_sse2_create().

00038 {
00039    struct translate *translate = NULL;
00040 
00041 #if defined(PIPE_ARCH_X86)
00042    translate = translate_sse2_create( key );
00043    if (translate)
00044       return translate;
00045 #endif
00046 
00047    return translate_generic_create( key );
00048 }

struct translate* translate_generic_create ( const struct translate_key key  )  [read]

Definition at line 671 of file translate_generic.c.

References translate_generic::attrib, translate_generic::buffer, CALLOC_STRUCT, translate_key::element, translate_generic::emit, translate_generic::fetch, generic_release(), generic_run(), generic_run_elts(), generic_set_buffer(), get_emit_func(), get_fetch_func(), translate_element::input_buffer, translate_element::input_format, translate_element::input_offset, translate_generic::input_offset, translate::key, translate_generic::nr_attrib, translate_key::nr_elements, translate_element::output_format, translate_element::output_offset, translate_generic::output_offset, translate::release, translate::set_buffer, and translate_generic::translate.

00672 {
00673    struct translate_generic *tg = CALLOC_STRUCT(translate_generic);
00674    unsigned i;
00675 
00676    if (tg == NULL)
00677       return NULL;
00678 
00679    tg->translate.key = *key;
00680    tg->translate.release = generic_release;
00681    tg->translate.set_buffer = generic_set_buffer;
00682    tg->translate.run_elts = generic_run_elts;
00683    tg->translate.run = generic_run;
00684 
00685    for (i = 0; i < key->nr_elements; i++) {
00686 
00687       tg->attrib[i].fetch = get_fetch_func(key->element[i].input_format);
00688       tg->attrib[i].buffer = key->element[i].input_buffer;
00689       tg->attrib[i].input_offset = key->element[i].input_offset;
00690 
00691       tg->attrib[i].emit = get_emit_func(key->element[i].output_format);
00692       tg->attrib[i].output_offset = key->element[i].output_offset;
00693 
00694    }
00695 
00696    tg->nr_attrib = key->nr_elements;
00697 
00698 
00699    return &tg->translate;
00700 }

static int translate_key_compare ( const struct translate_key a,
const struct translate_key b 
) [static]

Definition at line 103 of file translate.h.

References translate_keysize().

00105 {
00106    int keysize = translate_keysize(a);
00107    return memcmp(a, b, keysize);
00108 }

static void translate_key_sanitize ( struct translate_key a  )  [static]

Definition at line 111 of file translate.h.

References translate_keysize().

00112 {
00113    int keysize = translate_keysize(a);
00114    char *ptr = (char *)a;
00115    memset(ptr + keysize, 0, sizeof(*a) - keysize);
00116 }

static int translate_keysize ( const struct translate_key key  )  [static]

Definition at line 98 of file translate.h.

References translate_key::nr_elements.

00099 {
00100    return 2 * sizeof(int) + key->nr_elements * sizeof(struct translate_element);
00101 }

struct translate* translate_sse2_create ( const struct translate_key key  )  [read]

Definition at line 699 of file translate_sse.c.

00702 {


Generated on Tue Sep 29 06:25:27 2009 for Gallium3D by  doxygen 1.5.4