summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_vcache.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-03-23 18:21:00 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2008-03-23 18:21:00 +0000
commit301b187ca9a811b608894d20bab934af0a10b8ab (patch)
treea2721ffcfcfcd79e2e69515c369b252b16d9ae15 /src/gallium/auxiliary/draw/draw_pt_vcache.c
parentf40357e25c0520ef1d64ffab03501da4c8b93529 (diff)
draw: fix some unsigned vs ushort confusion
Middle-end elements are ushort, but prior to that have to treat all elements as unsigned to avoid wrapping and/or overruns.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_vcache.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_vcache.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_vcache.c b/src/gallium/auxiliary/draw/draw_pt_vcache.c
index 07e9f0ae5f..98c22eb4d4 100644
--- a/src/gallium/auxiliary/draw/draw_pt_vcache.c
+++ b/src/gallium/auxiliary/draw/draw_pt_vcache.c
@@ -45,7 +45,7 @@
struct vcache_frontend {
struct draw_pt_front_end base;
- ushort in[CACHE_MAX];
+ unsigned in[CACHE_MAX];
ushort out[CACHE_MAX];
ushort draw_elts[DRAW_MAX];
@@ -74,13 +74,14 @@ static void vcache_flush( struct vcache_frontend *vcache )
}
#endif
- if (vcache->draw_count)
+ if (vcache->draw_count) {
vcache->middle->run( vcache->middle,
vcache->output_prim,
vcache->fetch_elts,
vcache->fetch_count,
vcache->draw_elts,
vcache->draw_count );
+ }
memset(vcache->in, ~0, sizeof(vcache->in));
vcache->fetch_count = 0;
@@ -100,9 +101,7 @@ static void vcache_check_flush( struct vcache_frontend *vcache )
static void vcache_elt( struct vcache_frontend *vcache,
unsigned felt )
{
- // ushort felt = elt(draw, i);
-
- ushort idx = felt % CACHE_MAX;
+ unsigned idx = felt % CACHE_MAX;
if (vcache->in[idx] != felt) {
assert(vcache->fetch_count < FETCH_MAX);