summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-20 15:25:21 -0700
committerJason Ekstrand <[email protected]>2017-05-26 07:58:01 -0700
commit58a57ea7d6cd2313989ee9c9759d4270b0bd675d (patch)
tree773a27b91f0de070f42daabc2def0f5d2d063845
parent21ba2b4bef7c68fce492607b7dae5cd5e28b3bd9 (diff)
i965/sf: make brw_sf_prog_key::interp_mode an array
Having it be a pointer means that we end up caching clip programs based on a pointer to wm_prog_data rather than the actual interpolation modes. We've been caching one clip program per FS ever since 91d61fbf7cb61a44a where Timothy rewrote brw_setup_vue_interpolation(). Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index ff15c9755ff..5b2697961e6 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -207,7 +207,11 @@ brw_upload_sf_prog(struct brw_context *brw)
brw_wm_prog_data(brw->wm.base.prog_data);
if (wm_prog_data) {
key.contains_flat_varying = wm_prog_data->contains_flat_varying;
- key.interp_mode = wm_prog_data->interp_mode;
+
+ STATIC_ASSERT(sizeof(key.interp_mode) ==
+ sizeof(wm_prog_data->interp_mode));
+ memcpy(key.interp_mode, wm_prog_data->interp_mode,
+ sizeof(key.interp_mode));
}
/* _NEW_LIGHT | _NEW_PROGRAM */
diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h
index f372656349a..54503449f50 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.h
+++ b/src/mesa/drivers/dri/i965/brw_sf.h
@@ -47,7 +47,7 @@
struct brw_sf_prog_key {
GLbitfield64 attrs;
bool contains_flat_varying;
- const unsigned char *interp_mode;
+ unsigned char interp_mode[65]; /* BRW_VARYING_SLOT_COUNT */
uint8_t point_sprite_coord_replace;
GLuint primitive:2;
GLuint do_twoside_color:1;