diff options
author | Dave Airlie <[email protected]> | 2011-09-16 09:39:34 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-09-18 15:12:47 +0100 |
commit | 6dd284f7c8fac22f64c13fdf9909094f5ec59086 (patch) | |
tree | 8fe6c89638f05d1638b3a5d0395e011d68eda336 /src/gallium/drivers/svga | |
parent | 78026b8acef9d6eea4f37d9c5435447944d1befd (diff) |
gallium: move clear paths from rgba to a pointer to a color union (v2)
This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values.
Notes:
1. the value is opaque.
2. only when the value is used should it be interpretered according to
the surface format it is going to be used with.
3. float clears on integer buffers and vice-versa are undefined.
v2: fixed up vega and graw, dropped hunks that shouldn't have been in
patch.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_pipe_clear.c | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 34b9e85c1a3..f8c1ab40345 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -414,7 +414,7 @@ struct svga_context */ void svga_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, + const union pipe_color_union *color, double depth, unsigned stencil); diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 2bba77769ad..d9ff79cc5ee 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -37,7 +37,7 @@ static enum pipe_error try_clear(struct svga_context *svga, unsigned buffers, - const float *rgba, + const union pipe_color_union *color, double depth, unsigned stencil) { @@ -61,7 +61,7 @@ try_clear(struct svga_context *svga, if ((buffers & PIPE_CLEAR_COLOR) && fb->cbufs[0]) { flags |= SVGA3D_CLEAR_COLOR; - util_pack_color(rgba, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); + util_pack_color(color->f, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); rect.w = fb->cbufs[0]->width; rect.h = fb->cbufs[0]->height; @@ -104,7 +104,8 @@ try_clear(struct svga_context *svga, * No masking, no scissor (clear entire buffer). */ void -svga_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, +svga_clear(struct pipe_context *pipe, unsigned buffers, + const union pipe_color_union *color, double depth, unsigned stencil) { struct svga_context *svga = svga_context( pipe ); @@ -114,14 +115,14 @@ svga_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, SVGA_DBG(DEBUG_DMA, "clear sid %p\n", svga_surface(svga->curr.framebuffer.cbufs[0])->handle); - ret = try_clear( svga, buffers, rgba, depth, stencil ); + ret = try_clear( svga, buffers, color, depth, stencil ); if (ret == PIPE_ERROR_OUT_OF_MEMORY) { /* Flush command buffer and retry: */ svga_context_flush( svga, NULL ); - ret = try_clear( svga, buffers, rgba, depth, stencil ); + ret = try_clear( svga, buffers, color, depth, stencil ); } /* |