GLuint size, i;
size = cache->size * 3;
- items = calloc(1, size * sizeof(*items));
+ items = calloc(size, sizeof(*items));
for (i = 0; i < cache->size; i++)
for (c = cache->items[i]; c; c = next) {
*(void **)out_aux = ((char *)item->key + item->key_size);
if (item->offset != *inout_offset) {
- SET_DIRTY_BIT(cache, 1 << cache_id);
+ brw->state.dirty.cache |= (1 << cache_id);
*inout_offset = item->offset;
}
/* Since we have a new BO in place, we need to signal the units
* that depend on it (state base address on gen5+, or unit state before).
*/
- SET_DIRTY_BIT(brw, BRW_NEW_PROGRAM_CACHE);
+ brw->state.dirty.brw |= BRW_NEW_PROGRAM_CACHE;
}
/**
uint32_t *out_offset,
void *out_aux)
{
- struct brw_context *brw = cache->brw;
struct brw_cache_item *item = CALLOC_STRUCT(brw_cache_item);
GLuint hash;
void *tmp;
*out_offset = item->offset;
*(void **)out_aux = (void *)((char *)item->key + item->key_size);
- SET_DIRTY_BIT(cache, 1 << cache_id);
+ cache->brw->state.dirty.cache |= 1 << cache_id;
}
void
cache->size = 7;
cache->n_items = 0;
cache->items =
- calloc(1, cache->size * sizeof(struct brw_cache_item *));
+ calloc(cache->size, sizeof(struct brw_cache_item *));
cache->bo = drm_intel_bo_alloc(brw->bufmgr,
"program cache",
/* We need to make sure that the programs get regenerated, since
* any offsets leftover in brw_context will no longer be valid.
*/
- SET_DIRTY_ALL(mesa);
- SET_DIRTY64_ALL(brw);
- SET_DIRTY_ALL(cache);
+ brw->state.dirty.mesa |= ~0;
+ brw->state.dirty.brw |= ~0;
+ brw->state.dirty.cache |= ~0;
intel_batchbuffer_flush(brw);
}