summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/draw/draw_twoside.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-09-21 12:41:24 -0600
committerBrian <[email protected]>2007-09-25 14:18:17 -0600
commitff08c7b032fb17e4ffcda7497488dc5e263a7d6e (patch)
tree34232cd95e6ed42bcdc4bd62ab1e19b808664203 /src/mesa/pipe/draw/draw_twoside.c
parent608914aeb068a0d59da5c239fb5ff28b522e064d (diff)
test for presence of both front and back color vertex slots
Diffstat (limited to 'src/mesa/pipe/draw/draw_twoside.c')
-rw-r--r--src/mesa/pipe/draw/draw_twoside.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/pipe/draw/draw_twoside.c b/src/mesa/pipe/draw/draw_twoside.c
index 7f0cb98b30b..d987b005986 100644
--- a/src/mesa/pipe/draw/draw_twoside.c
+++ b/src/mesa/pipe/draw/draw_twoside.c
@@ -68,6 +68,9 @@ static INLINE void copy_attrib( unsigned attr_dst,
}
+/**
+ * Copy back color(s) to front color(s).
+ */
static struct vertex_header *copy_bfc( struct twoside_stage *twoside,
const struct vertex_header *v,
unsigned idx )
@@ -75,12 +78,12 @@ static struct vertex_header *copy_bfc( struct twoside_stage *twoside,
struct vertex_header *tmp = dup_vert( &twoside->stage, v, idx );
const struct draw_context *draw = twoside->stage.draw;
- if (draw->attrib_front0 != -1) {
- assert(draw->attrib_back0 != -1);
+ if (draw->attrib_front0 && draw->attrib_back0) {
+ assert(draw->attrib_back0);
copy_attrib(draw->attrib_front0, draw->attrib_back0, tmp);
}
- if (draw->attrib_front1 != -1) {
- assert(draw->attrib_back1 != -1);
+ if (draw->attrib_front1 && draw->attrib_back1) {
+ assert(draw->attrib_back1);
copy_attrib(draw->attrib_front1, draw->attrib_back1, tmp);
}