diff options
author | Keith Whitwell <keithw@vmware.com> | 2010-01-11 12:06:51 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2010-01-11 12:12:59 +0000 |
commit | 86f450060debebd66dd5fb72f83800d7634efeaa (patch) | |
tree | 9042a96f8a3257bfa3a624ba157bcf7279ba8028 /src/gallium/drivers/llvmpipe/lp_bld_interp.c | |
parent | ad74ea286951634d49d500f2e5ce740072794fe2 (diff) |
llvmpipe: force constant interpolation of flatshade colors
Nice speedup for gears.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_interp.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_interp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_interp.c b/src/gallium/drivers/llvmpipe/lp_bld_interp.c index daedf40d558..a6acaead887 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_interp.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_interp.c @@ -316,6 +316,7 @@ pos_update(struct lp_build_interp_soa_context *bld, int quad_index) void lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, const struct tgsi_token *tokens, + boolean flatshade, LLVMBuilderRef builder, struct lp_type type, LLVMValueRef a0_ptr, @@ -358,7 +359,15 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, for( attrib = first; attrib <= last; ++attrib ) { bld->mask[1 + attrib] = mask; - bld->mode[1 + attrib] = decl->Declaration.Interpolate; + + /* XXX: have mesa set INTERP_CONSTANT in the fragment + * shader. + */ + if (decl->Semantic.Name == TGSI_SEMANTIC_COLOR && + flatshade) + bld->mode[1 + attrib] = TGSI_INTERPOLATE_CONSTANT; + else + bld->mode[1 + attrib] = decl->Declaration.Interpolate; } bld->num_attribs = MAX2(bld->num_attribs, 1 + last + 1); |