diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-07-27 10:50:35 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-07-27 10:50:35 -0600 |
commit | 05ba76757b7349f0c3de2d9ce42c543fa7e931c2 (patch) | |
tree | 61e486fcd903df3adac18eef7d5c6eb3755a953e /src/mesa/pipe/softpipe/sp_state_derived.c | |
parent | 05bde092f39e16463dfbbe038f22f17da4346527 (diff) |
Clip triangles against softpipe->cliprect which includes scissor and surface bounds.
This prevents rendering out of bounds when the viewport is partially outside the surface bounds.
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_state_derived.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_derived.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c index 9572890afe..e1faaed93c 100644 --- a/src/mesa/pipe/softpipe/sp_state_derived.c +++ b/src/mesa/pipe/softpipe/sp_state_derived.c @@ -185,15 +185,15 @@ compute_cliprect(struct softpipe_context *sp) /* clip to scissor rect */ sp->cliprect.minx = MAX2(sp->scissor.minx, 0); sp->cliprect.miny = MAX2(sp->scissor.miny, 0); - sp->cliprect.maxx = MIN2(sp->scissor.maxx, surfWidth - 1); - sp->cliprect.maxy = MIN2(sp->scissor.maxy, surfHeight - 1); + sp->cliprect.maxx = MIN2(sp->scissor.maxx, surfWidth); + sp->cliprect.maxy = MIN2(sp->scissor.maxy, surfHeight); } else { /* clip to surface bounds */ sp->cliprect.minx = 0; sp->cliprect.miny = 0; - sp->cliprect.maxx = surfWidth - 1; - sp->cliprect.maxy = surfHeight - 1; + sp->cliprect.maxx = surfWidth; + sp->cliprect.maxy = surfHeight; } } |