aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-19 21:20:28 -0700
committerJason Ekstrand <[email protected]>2017-05-26 07:58:01 -0700
commitc30587643e34a1f7586adf961e4340bbce90b969 (patch)
treecc1b2028d94663d426266be9cafd027a2eaccbee /src/mesa
parent58a57ea7d6cd2313989ee9c9759d4270b0bd675d (diff)
i965/clip: Make brw_clip_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]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 4187207c6d0..34325a719be 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -155,7 +155,11 @@ brw_upload_clip_prog(struct brw_context *brw)
key.contains_flat_varying = wm_prog_data->contains_flat_varying;
key.contains_noperspective_varying =
wm_prog_data->contains_noperspective_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));
}
/* BRW_NEW_REDUCED_PRIMITIVE */
diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h
index 9dc1f12ea52..2dc84d80c75 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.h
+++ b/src/mesa/drivers/dri/i965/brw_clip.h
@@ -49,7 +49,7 @@ struct brw_clip_prog_key {
GLbitfield64 attrs;
bool contains_flat_varying;
bool contains_noperspective_varying;
- const unsigned char *interp_mode;
+ unsigned char interp_mode[65]; /* BRW_VARYING_SLOT_COUNT */
GLuint primitive:4;
GLuint nr_userclip:4;
GLuint pv_first:1;