svga: fix crash when clearing null color buffer

Fixes regression since 9baa45f78b
but some of the piglit fbo-drawbuffers-none tests still don't
pass.

v2: use the right pointer type for 'h'

Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Brian Paul
2014-01-16 13:53:27 -08:00
parent d6fa71fbb0
commit 3618ac4f20
+7 -3
View File
@@ -111,9 +111,13 @@ svga_clear(struct pipe_context *pipe, unsigned buffers,
struct svga_context *svga = svga_context( pipe );
enum pipe_error ret;
if (buffers & PIPE_CLEAR_COLOR)
SVGA_DBG(DEBUG_DMA, "clear sid %p\n",
svga_surface(svga->curr.framebuffer.cbufs[0])->handle);
if (buffers & PIPE_CLEAR_COLOR) {
struct svga_winsys_surface *h = NULL;
if (svga->curr.framebuffer.cbufs[0]) {
h = svga_surface(svga->curr.framebuffer.cbufs[0])->handle;
}
SVGA_DBG(DEBUG_DMA, "clear sid %p\n", h);
}
/* flush any queued prims (don't want them to appear after the clear!) */
svga_hwtnl_flush_retry(svga);