diff options
author | Chris Forbes <[email protected]> | 2013-07-07 19:47:19 +1200 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2013-08-01 20:58:56 +1200 |
commit | f0feb32eaf8d4b35e5c3a47ef90aa876b231ada6 (patch) | |
tree | 822a6125023093b62c12693eb5b817226d2debec /src/mesa/drivers/dri/i965/brw_clip_tri.c | |
parent | 21922cb70d0a2de23f6080c8b9c4324cba5a2fff (diff) |
i965 Gen4/5: clip: correctly handle flat varyings
Previously we only gave special treatment to the builtin color varyings.
This patch adds support for arbitrary flat-shaded varyings, which is
required for GLSL 1.30.
Based on Olivier Galibert's patch from last year:
http://lists.freedesktop.org/archives/mesa-dev/2012-July/024340.html
V5: Move key.do_flat_shading to brw_clip_compile.has_flat_shading
V6: Real bools.
[V1-2]: Signed-off-by: Olivier Galibert <galibert at pobox.com>
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip_tri.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_clip_tri.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c index bea08530ec0..19179c1fc9d 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c @@ -190,8 +190,8 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c ) brw_IF(p, BRW_EXECUTE_1); { - brw_clip_copy_colors(c, 1, 0); - brw_clip_copy_colors(c, 2, 0); + brw_clip_copy_flatshaded_attributes(c, 1, 0); + brw_clip_copy_flatshaded_attributes(c, 2, 0); } brw_ELSE(p); { @@ -203,19 +203,19 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c ) brw_imm_ud(_3DPRIM_TRIFAN)); brw_IF(p, BRW_EXECUTE_1); { - brw_clip_copy_colors(c, 0, 1); - brw_clip_copy_colors(c, 2, 1); + brw_clip_copy_flatshaded_attributes(c, 0, 1); + brw_clip_copy_flatshaded_attributes(c, 2, 1); } brw_ELSE(p); { - brw_clip_copy_colors(c, 1, 0); - brw_clip_copy_colors(c, 2, 0); + brw_clip_copy_flatshaded_attributes(c, 1, 0); + brw_clip_copy_flatshaded_attributes(c, 2, 0); } brw_ENDIF(p); } else { - brw_clip_copy_colors(c, 0, 2); - brw_clip_copy_colors(c, 1, 2); + brw_clip_copy_flatshaded_attributes(c, 0, 2); + brw_clip_copy_flatshaded_attributes(c, 1, 2); } } brw_ENDIF(p); @@ -645,7 +645,7 @@ void brw_emit_tri_clip( struct brw_clip_compile *c ) * flatshading, need to apply the flatshade here because we don't * respect the PV when converting to trifan for emit: */ - if (c->key.do_flat_shading) + if (c->has_flat_shading) brw_clip_tri_flat_shade(c); if ((c->key.clip_mode == BRW_CLIPMODE_NORMAL) || |