summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_emit.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-09-23 15:27:55 -0700
committerEric Anholt <[email protected]>2014-09-23 17:23:29 -0700
commit45b104e0a228595142ed4bc62bbc8948100b9325 (patch)
tree6c23588560123540d5d42fb532ba92f4b13a50bb /src/gallium/drivers/vc4/vc4_emit.c
parent0e7bc3088be693284fba80519be825e6e8218e40 (diff)
vc4: Add support for flat shading.
This is just the GL 1.1 flat shading of colors -- we don't need to support TGSI constant interpolation bits, because we don't do GLSL 1.30. Fixes 7 piglit tests.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_emit.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_emit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_emit.c b/src/gallium/drivers/vc4/vc4_emit.c
index 476ea9c6fd4..2a25ca08b9d 100644
--- a/src/gallium/drivers/vc4/vc4_emit.c
+++ b/src/gallium/drivers/vc4/vc4_emit.c
@@ -62,4 +62,10 @@ vc4_emit_state(struct pipe_context *pctx)
cl_u16(&vc4->bcl, 16 * vc4->viewport.translate[0]);
cl_u16(&vc4->bcl, 16 * vc4->viewport.translate[1]);
}
+
+ if (vc4->dirty & VC4_DIRTY_FLAT_SHADE_FLAGS) {
+ cl_u8(&vc4->bcl, VC4_PACKET_FLAT_SHADE_FLAGS);
+ cl_u32(&vc4->bcl, vc4->rasterizer->base.flatshade ?
+ vc4->prog.fs->color_inputs : 0);
+ }
}