diff options
author | Keith Whitwell <[email protected]> | 2008-05-09 13:10:15 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-05-12 17:40:54 +0100 |
commit | 7ddb925b8bc6c18eba953e34d2b630a3a6593f05 (patch) | |
tree | 80b01057221fcea59f440940d77e2b533cd38363 /src/gallium/auxiliary/draw/draw_pt_fetch.c | |
parent | c0a6040f568e0c9be07797b2dc2fdd8a3624ec34 (diff) |
draw: mimize cost of translate key compares, use cache universally
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_fetch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index 034e0eccb26..07f4c991642 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -62,11 +62,8 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch, unsigned i, nr = 0; unsigned dst_offset = 0; struct translate_key key; - unsigned keysize; fetch->vertex_size = vertex_size; - keysize = (2*4 + - (draw->pt.nr_vertex_elements + 1) * sizeof(key.element[0])); /* Always emit/leave space for a vertex header. * @@ -111,9 +108,9 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch, if (!fetch->translate || - memcmp(&fetch->translate->key, &key, keysize) != 0) + translate_key_compare(&fetch->translate->key, &key) != 0) { - memset((char *)&key + keysize, 0, sizeof(key) - keysize); + translate_key_sanitize(&key); fetch->translate = translate_cache_find(fetch->cache, &key); { |