diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-10-10 15:09:57 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-10-10 15:09:57 -0600 |
commit | 9f8cfa75ca0882a8015a714887b41f8a7a10fd19 (patch) | |
tree | 16e46e2adf70df086914451d55304d532856c736 /src | |
parent | 8b68104b90b1d136b5f67a196c6cbdf9fe4dbfe1 (diff) |
fix softpipe_clear() to handle ps->offset!=0 (such as when rendering to texture and level!=0)
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_clear.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_clear.c b/src/mesa/pipe/softpipe/sp_clear.c index 2d5344f424..539da1d58b 100644 --- a/src/mesa/pipe/softpipe/sp_clear.c +++ b/src/mesa/pipe/softpipe/sp_clear.c @@ -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); |