summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_surface.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-21 00:11:25 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-21 00:11:25 +1100
commitc7e9cb10937391c25a884fe62db91ea9b910d672 (patch)
tree42a854fef74df0d07421ebe466857260fe096e1a /src/gallium/drivers/softpipe/sp_state_surface.c
parent62767cf2dd1006621ecd6023b15d65b5cff41dfa (diff)
parent122ed506f4b808503b230bade421018614dbe696 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_surface.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_surface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_surface.c b/src/gallium/drivers/softpipe/sp_state_surface.c
index 124b18b708..2f55684464 100644
--- a/src/gallium/drivers/softpipe/sp_state_surface.c
+++ b/src/gallium/drivers/softpipe/sp_state_surface.c
@@ -48,6 +48,9 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
struct softpipe_context *sp = softpipe_context(pipe);
uint i;
+ /* updated below */
+ sp->fb_width = sp->fb_height = 0;
+
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
/* check if changing cbuf */
if (sp->framebuffer.cbufs[i] != fb->cbufs[i]) {
@@ -60,6 +63,10 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* update cache */
sp_tile_cache_set_surface(sp->cbuf_cache[i], fb->cbufs[i]);
}
+ if (fb->cbufs[i]) {
+ sp->fb_width = fb->cbufs[i]->width;
+ sp->fb_height = fb->cbufs[i]->height;
+ }
}
sp->framebuffer.num_cbufs = fb->num_cbufs;
@@ -74,6 +81,11 @@ softpipe_set_framebuffer_state(struct pipe_context *pipe,
/* update cache */
sp_tile_cache_set_surface(sp->zsbuf_cache, fb->zsbuf);
+
+ if (!sp->fb_width && fb->zsbuf) {
+ sp->fb_width = fb->zsbuf->width;
+ sp->fb_height = fb->zsbuf->height;
+ }
}
#if 0