#include "brw_state.h"
#include "brw_vs.h"
#include "brw_wm.h"
+#include "brw_vs.h"
#define FILE_DEBUG_FLAG DEBUG_STATE
cache->size = 7;
cache->n_items = 0;
cache->items =
- calloc(1, cache->size * sizeof(struct brw_cache_item));
+ calloc(1, cache->size * sizeof(struct brw_cache_item *));
cache->bo = drm_intel_bo_alloc(intel->bufmgr,
"program cache",
cache->aux_compare[BRW_VS_PROG] = brw_vs_prog_data_compare;
cache->aux_compare[BRW_WM_PROG] = brw_wm_prog_data_compare;
+ cache->aux_free[BRW_VS_PROG] = brw_vs_prog_data_free;
+ cache->aux_free[BRW_WM_PROG] = brw_wm_prog_data_free;
}
static void
for (i = 0; i < cache->size; i++) {
for (c = cache->items[i]; c; c = next) {
next = c->next;
+ if (cache->aux_free[c->cache_id]) {
+ const void *item_aux = c->key + c->key_size;
+ cache->aux_free[c->cache_id](item_aux);
+ }
free((void *)c->key);
free(c);
}