summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_pipe_clear.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-05-29 01:22:23 +0200
committerRoland Scheidegger <sroland@vmware.com>2010-05-29 01:22:23 +0200
commitd1998962efe9069c6cafe6c59f62f0590586d4a6 (patch)
treea8486a4cb34b60131f248527af2f11bcdb19fc46 /src/gallium/drivers/svga/svga_pipe_clear.c
parent72c77d472b21276c56778bb24a786737f17bb936 (diff)
svga: adapt to clear interface changes
this should support separate stencil/depth clears just fine.
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_clear.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_clear.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index cbff95c917..41f239c1a8 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -61,9 +61,11 @@ try_clear(struct svga_context *svga,
}
if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && fb->zsbuf) {
- flags |= SVGA3D_CLEAR_DEPTH;
+ if (buffers & PIPE_CLEAR_DEPTH)
+ flags |= SVGA3D_CLEAR_DEPTH;
- if (svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8_USCALED_Z24_UNORM)
+ if ((svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8_USCALED_Z24_UNORM) &&
+ (buffers & PIPE_CLEAR_STENCIL))
flags |= SVGA3D_CLEAR_STENCIL;
rect.w = MAX2(rect.w, fb->zsbuf->width);
@@ -100,7 +102,7 @@ svga_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba,
{
struct svga_context *svga = svga_context( pipe );
int ret;
-
+
if (buffers & PIPE_CLEAR_COLOR)
SVGA_DBG(DEBUG_DMA, "clear sid %p\n",
svga_surface(svga->curr.framebuffer.cbufs[0])->handle);