summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_clip.c
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-07-07 19:47:19 +1200
committerChris Forbes <[email protected]>2013-08-01 20:58:56 +1200
commitf0feb32eaf8d4b35e5c3a47ef90aa876b231ada6 (patch)
tree822a6125023093b62c12693eb5b817226d2debec /src/mesa/drivers/dri/i965/brw_clip.c
parent21922cb70d0a2de23f6080c8b9c4324cba5a2fff (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.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 7621675969d..1c2a4bc6eb8 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -70,6 +70,9 @@ static void compile_clip_prog( struct brw_context *brw,
c.key = *key;
c.vue_map = brw->vue_map_geom_out;
+ c.has_flat_shading =
+ brw_any_flat_varyings(&key->interpolation_mode);
+
/* nr_regs is the number of registers filled by reading data from the VUE.
* This program accesses the entire VUE, so nr_regs needs to be the size of
* the VUE (measured in pairs, since two slots are stored in each
@@ -149,8 +152,8 @@ brw_upload_clip_prog(struct brw_context *brw)
key.primitive = brw->reduced_primitive;
/* BRW_NEW_VUE_MAP_GEOM_OUT */
key.attrs = brw->vue_map_geom_out.slots_valid;
+
/* _NEW_LIGHT */
- key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT);
key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
/* _NEW_TRANSFORM (also part of VUE map)*/
key.nr_userclip = _mesa_bitcount_64(ctx->Transform.ClipPlanesEnabled);