summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_fetch.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-09 13:10:15 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-09 13:10:15 +0100
commit1a03812fb57e956b438cd42ac68978facb49a99d (patch)
treeac343109823d355ce7cff5816ab8e5cc90a5252a /src/gallium/auxiliary/draw/draw_pt_fetch.c
parent80474d576c2e92441f6bcc18faae71a38b91bd70 (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.c7
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 a5bebb4ca1..100117a9ae 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);
{