diff options
author | Kenneth Graunke <[email protected]> | 2012-08-13 23:42:23 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-08-27 14:23:40 -0700 |
commit | ab17762c70852ca8fc400d7b5c6696d412ff2afe (patch) | |
tree | db2a80aa994379cb63c1424acc9039631c558aac /src/mesa/drivers/dri/i965/brw_fs.cpp | |
parent | 6cc14c2493bb6957f2581671020809e90a8d8643 (diff) |
i965: Only set proj_attrib_mask for fixed function.
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 <[email protected]>
Suggested-by: Eric Anholt <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index ae462f7fcfe..ebb52fcef43 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2155,6 +2155,9 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog) 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); @@ -2162,7 +2165,8 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog) 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); |