diff options
author | Brian Paul <brianp@vmware.com> | 2009-06-16 15:41:49 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-06-16 15:41:49 -0600 |
commit | 742ba084068b6856e94283a9c5fe3b39d48f64cb (patch) | |
tree | 3692aceeaf80211e49602086a4f25626f2f14729 | |
parent | 3e48dd04456aaf2d42dfa7f3a3c99a95a5986eb6 (diff) |
softpipe: fix out of bounds quad rasterization bug
For some triangles we can generate quads which lie just outside the
surface bounds. Just check the quad's mask before trying to emit/process
the quad.
Fixes failed assertion in Lightsmark.
-rw-r--r-- | src/gallium/drivers/softpipe/sp_setup.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index accc692b66..e5be65242d 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -444,7 +444,8 @@ static void flush_spans( struct setup_context *setup ) mask |= MASK_TOP_RIGHT; if (x+1 >= xleft1 && x+1 < xright1) mask |= MASK_BOTTOM_RIGHT; - EMIT_QUAD( setup, x, setup->span.y, mask ); + if (mask) + EMIT_QUAD( setup, x, setup->span.y, mask ); } break; @@ -458,7 +459,8 @@ static void flush_spans( struct setup_context *setup ) mask |= MASK_TOP_LEFT; if (x+1 >= xleft0 && x+1 < xright0) mask |= MASK_TOP_RIGHT; - EMIT_QUAD( setup, x, setup->span.y, mask ); + if (mask) + EMIT_QUAD( setup, x, setup->span.y, mask ); } break; @@ -472,7 +474,8 @@ static void flush_spans( struct setup_context *setup ) mask |= MASK_BOTTOM_LEFT; if (x+1 >= xleft1 && x+1 < xright1) mask |= MASK_BOTTOM_RIGHT; - EMIT_QUAD( setup, x, setup->span.y, mask ); + if (mask) + EMIT_QUAD( setup, x, setup->span.y, mask ); } break; |