summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp6
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d0f5fea3d32..5a5bfeb7fca 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2987,6 +2987,12 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
if (prog->Name != 0)
key.proj_attrib_mask = ~(GLbitfield64) 0;
+ else {
+ /* Bit VARYING_BIT_POS of key.proj_attrib_mask is never used, so to
+ * avoid unnecessary recompiles, always set it to 1.
+ */
+ key.proj_attrib_mask |= VARYING_BIT_POS;
+ }
if (intel->gen < 6)
key.vp_outputs_written |= BITFIELD64_BIT(VARYING_SLOT_POS);
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 39cbbb756ff..bec8d8560b4 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -429,8 +429,12 @@ static void brw_wm_populate_key( struct brw_context *brw,
*/
if (ctx->Shader.CurrentFragmentProgram)
key->proj_attrib_mask = ~(GLbitfield64) 0;
- else
- key->proj_attrib_mask = brw->wm.input_size_masks[4-1];
+ else {
+ /* Bit VARYING_BIT_POS of key.proj_attrib_mask is never used, so to
+ * avoid unnecessary recompiles, always set it to 1.
+ */
+ key->proj_attrib_mask = brw->wm.input_size_masks[4-1] | VARYING_BIT_POS;
+ }
/* _NEW_LIGHT */
key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT);