summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state.c
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2011-03-06 11:44:06 +0100
committerDaniel Vetter <[email protected]>2011-03-10 23:04:19 +0100
commit6ad4a11b3e14fcccf662d8ccc58486c16ce0c9f4 (patch)
tree4a80de4a3be5c23c112765a2d74de906a767e0d8 /src/gallium/drivers/i915/i915_state.c
parent6358e6371b31671acbfa7c00336673f62ee928c5 (diff)
i915g: make set_framebuffer_state more robust
u_blitter is lazy and doesn't fully clear it's stack-allocated fb. Signed-off-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r--src/gallium/drivers/i915/i915_state.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index 58bbbd1de2c..a694649c417 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -642,7 +642,8 @@ static void i915_set_framebuffer_state(struct pipe_context *pipe,
i915->framebuffer.height = fb->height;
i915->framebuffer.nr_cbufs = fb->nr_cbufs;
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
- pipe_surface_reference(&i915->framebuffer.cbufs[i], fb->cbufs[i]);
+ pipe_surface_reference(&i915->framebuffer.cbufs[i],
+ i < fb->nr_cbufs ? fb->cbufs[i] : NULL);
}
pipe_surface_reference(&i915->framebuffer.zsbuf, fb->zsbuf);