summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_surface.c
diff options
context:
space:
mode:
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