mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-23 03:00:37 +02:00
In get_vertex(), slot was computed using & 31. Replace with % VCACHE_SIZE.
Also, assert that index is not too large before indexing array.
This commit is contained in:
parent
be04999982
commit
40e46d0727
1 changed files with 3 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ void draw_vertex_cache_invalidate( struct draw_context *draw )
|
|||
static struct vertex_header *get_vertex( struct draw_context *draw,
|
||||
unsigned i )
|
||||
{
|
||||
unsigned slot = (i + (i>>5)) & 31;
|
||||
unsigned slot = (i + (i>>5)) % VCACHE_SIZE;
|
||||
|
||||
/* Cache miss?
|
||||
*/
|
||||
|
|
@ -74,6 +74,8 @@ static struct vertex_header *get_vertex( struct draw_context *draw,
|
|||
draw->vcache.referenced |= (1 << slot); /* slot now in use */
|
||||
}
|
||||
|
||||
assert(slot < Elements(draw->vcache.idx));
|
||||
|
||||
draw->vcache.idx[slot] = i;
|
||||
|
||||
/* Add to vertex shader queue:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue