[965] Fix massively broken state cache dirty flagging.
It was flagging a last_bo update even when last_bo didn't change, but another part was failing to update last_bo when it should have.
This commit is contained in:
parent
76430815a7
commit
0500467044
|
@ -85,7 +85,7 @@ static GLuint hash_key( const void *key, GLuint key_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Include the BO pointers as key data as well */
|
/* Include the BO pointers as key data as well */
|
||||||
ikey = (void *)reloc_bufs;
|
ikey = (GLuint *)reloc_bufs;
|
||||||
key_size = nr_reloc_bufs * sizeof(dri_bo *);
|
key_size = nr_reloc_bufs * sizeof(dri_bo *);
|
||||||
for (i = 0; i < key_size/4; i++) {
|
for (i = 0; i < key_size/4; i++) {
|
||||||
hash ^= ikey[i];
|
hash ^= ikey[i];
|
||||||
|
@ -102,6 +102,9 @@ static void
|
||||||
update_cache_last(struct brw_cache *cache, enum brw_cache_id cache_id,
|
update_cache_last(struct brw_cache *cache, enum brw_cache_id cache_id,
|
||||||
dri_bo *bo)
|
dri_bo *bo)
|
||||||
{
|
{
|
||||||
|
if (bo == cache->last_bo[cache_id])
|
||||||
|
return; /* no change */
|
||||||
|
|
||||||
dri_bo_unreference(cache->last_bo[cache_id]);
|
dri_bo_unreference(cache->last_bo[cache_id]);
|
||||||
cache->last_bo[cache_id] = bo;
|
cache->last_bo[cache_id] = bo;
|
||||||
dri_bo_reference(cache->last_bo[cache_id]);
|
dri_bo_reference(cache->last_bo[cache_id]);
|
||||||
|
@ -255,7 +258,7 @@ brw_upload_cache( struct brw_cache *cache,
|
||||||
if (INTEL_DEBUG & DEBUG_STATE)
|
if (INTEL_DEBUG & DEBUG_STATE)
|
||||||
_mesa_printf("upload %s: %d bytes to cache id %d\n",
|
_mesa_printf("upload %s: %d bytes to cache id %d\n",
|
||||||
cache->name[cache_id],
|
cache->name[cache_id],
|
||||||
data_size);
|
data_size, cache_id);
|
||||||
|
|
||||||
/* Copy data to the buffer */
|
/* Copy data to the buffer */
|
||||||
dri_bo_subdata(bo, 0, data_size, data);
|
dri_bo_subdata(bo, 0, data_size, data);
|
||||||
|
@ -282,6 +285,7 @@ brw_cache_data_sz(struct brw_cache *cache,
|
||||||
item = search_cache(cache, cache_id, hash, data, data_size,
|
item = search_cache(cache, cache_id, hash, data, data_size,
|
||||||
reloc_bufs, nr_reloc_bufs);
|
reloc_bufs, nr_reloc_bufs);
|
||||||
if (item) {
|
if (item) {
|
||||||
|
update_cache_last(cache, cache_id, item->bo);
|
||||||
dri_bo_reference(item->bo);
|
dri_bo_reference(item->bo);
|
||||||
return item->bo;
|
return item->bo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue