brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.
However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key. Turning it off for
shaders should allow the precompile to work and not lose much.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
key.iz_lookup |= IZ_DEPTH_WRITE_ENABLE_BIT;
}
+ if (prog->Name != 0)
+ key.proj_attrib_mask = 0xffffffff;
+
if (intel->gen < 6)
key.vp_outputs_written |= BITFIELD64_BIT(FRAG_ATTRIB_WPOS);
if (!(fp->Base.InputsRead & BITFIELD64_BIT(i)))
continue;
- key.proj_attrib_mask |= 1 << i;
+ if (prog->Name == 0)
+ key.proj_attrib_mask |= 1 << i;
if (intel->gen < 6) {
int vp_index = _mesa_vert_result_to_frag_attrib((gl_vert_result) i);
key->stats_wm = brw->intel.stats_wm;
/* BRW_NEW_WM_INPUT_DIMENSIONS */
- key->proj_attrib_mask = brw->wm.input_size_masks[4-1];
+ /* Only set this for fixed function. The optimization it enables isn't
+ * useful for programs using shaders.
+ */
+ if (ctx->Shader.CurrentFragmentProgram)
+ key->proj_attrib_mask = 0xffffffff;
+ else
+ key->proj_attrib_mask = brw->wm.input_size_masks[4-1];
/* _NEW_LIGHT */
key->flat_shade = (ctx->Light.ShadeModel == GL_FLAT);