summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_state_cache.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-08-26 21:19:05 -0700
committerEric Anholt <eric@anholt.net>2012-09-07 08:29:48 -0700
commit99596cba7828af67bfcd0f2dafcb44b65d39d239 (patch)
tree63e28d5649672a7bace85866af04a046e34b8f5f /src/mesa/drivers/dri/i965/brw_state_cache.c
parent5bb94f2bc4c7b7bc707d22f3dba9216d794d4393 (diff)
downloadexternal_mesa3d-99596cba7828af67bfcd0f2dafcb44b65d39d239.zip
external_mesa3d-99596cba7828af67bfcd0f2dafcb44b65d39d239.tar.gz
external_mesa3d-99596cba7828af67bfcd0f2dafcb44b65d39d239.tar.bz2
i965: Add functions for comparing two brw_wm/vs_prog_data structs.
Currently, this just avoids comparing all unused parts of param[] and pull_param[], but it's a step toward getting rid of those giant statically sized arrays. v2: Actually use the new function instead of just looking at its address. This required changing the args to const pointers. (review by Kenneth) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_state_cache.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_cache.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index d9cc520..92b81c7 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -47,6 +47,8 @@
#include "main/imports.h"
#include "intel_batchbuffer.h"
#include "brw_state.h"
+#include "brw_vs.h"
+#include "brw_wm.h"
#define FILE_DEBUG_FLAG DEBUG_STATE
@@ -211,7 +213,12 @@ brw_try_upload_using_copy(struct brw_cache *cache,
continue;
}
- if (memcmp(item_aux, aux, item->aux_size) != 0) {
+ if (cache->aux_compare[result_item->cache_id]) {
+ if (!cache->aux_compare[result_item->cache_id](item_aux, aux,
+ item->aux_size,
+ item->key))
+ continue;
+ } else if (memcmp(item_aux, aux, item->aux_size) != 0) {
continue;
}
@@ -333,6 +340,9 @@ brw_init_caches(struct brw_context *brw)
cache->bo = drm_intel_bo_alloc(intel->bufmgr,
"program cache",
4096, 64);
+
+ cache->aux_compare[BRW_VS_PROG] = brw_vs_prog_data_compare;
+ cache->aux_compare[BRW_WM_PROG] = brw_wm_prog_data_compare;
}
static void