fix softpipe_clear() to handle ps->offset!=0 (such as when rendering to texture and...
authorBrian <brian.paul@tungstengraphics.com>
Wed, 10 Oct 2007 21:09:57 +0000 (15:09 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 10 Oct 2007 21:09:57 +0000 (15:09 -0600)
src/mesa/pipe/softpipe/sp_clear.c

index 2d5344f424bba6f76e938cb9ff81bcfb767ccaf0..539da1d58b3720e9cc716cf2bb3a45d93c34243e 100644 (file)
@@ -50,11 +50,17 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
 
    softpipe_update_derived(softpipe); /* not needed?? */
 
-   x = 0;
-   y = 0;
    w = softpipe->framebuffer.cbufs[0]->width;
    h = softpipe->framebuffer.cbufs[0]->height;
 
+   /* Use the X coord to trick region_fill() into filling at an offset
+    * from the start of the region.  Perhaps pipe_region should have the
+    * 'offset' field, not pipe_surface???
+    */
+   assert(ps->offset % ps->region->cpp == 0);
+   x = ps->offset / ps->region->cpp;
+   y = 0;
+
    assert(w <= ps->region->pitch);
    assert(h <= ps->region->height);