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/nvc0/nvc0_surface.c | |
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/nvc0/nvc0_surface.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_surface.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c index 61aa1a17f1d..ff07aad00d0 100644 --- a/src/gallium/drivers/nvc0/nvc0_surface.c +++ b/src/gallium/drivers/nvc0/nvc0_surface.c @@ -267,7 +267,7 @@ nvc0_resource_copy_region(struct pipe_context *pipe, static void nvc0_clear_render_target(struct pipe_context *pipe, struct pipe_surface *dst, - const float *rgba, + const union pipe_color_union *color, unsigned dstx, unsigned dsty, unsigned width, unsigned height) { @@ -279,10 +279,10 @@ nvc0_clear_render_target(struct pipe_context *pipe, struct nouveau_bo *bo = mt->base.bo; BEGIN_RING(chan, RING_3D(CLEAR_COLOR(0)), 4); - OUT_RINGf (chan, rgba[0]); - OUT_RINGf (chan, rgba[1]); - OUT_RINGf (chan, rgba[2]); - OUT_RINGf (chan, rgba[3]); + OUT_RINGf (chan, color->f[0]); + OUT_RINGf (chan, color->f[1]); + OUT_RINGf (chan, color->f[2]); + OUT_RINGf (chan, color->f[3]); if (MARK_RING(chan, 18, 2)) return; @@ -377,7 +377,8 @@ nvc0_clear_depth_stencil(struct pipe_context *pipe, void nvc0_clear(struct pipe_context *pipe, unsigned buffers, - const float *rgba, double depth, unsigned stencil) + const union pipe_color_union *color, + double depth, unsigned stencil) { struct nvc0_context *nvc0 = nvc0_context(pipe); struct nouveau_channel *chan = nvc0->screen->base.channel; @@ -391,10 +392,10 @@ nvc0_clear(struct pipe_context *pipe, unsigned buffers, if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) { BEGIN_RING(chan, RING_3D(CLEAR_COLOR(0)), 4); - OUT_RINGf (chan, rgba[0]); - OUT_RINGf (chan, rgba[1]); - OUT_RINGf (chan, rgba[2]); - OUT_RINGf (chan, rgba[3]); + OUT_RINGf (chan, color->f[0]); + OUT_RINGf (chan, color->f[1]); + OUT_RINGf (chan, color->f[2]); + OUT_RINGf (chan, color->f[3]); mode = NVC0_3D_CLEAR_BUFFERS_R | NVC0_3D_CLEAR_BUFFERS_G | NVC0_3D_CLEAR_BUFFERS_B | NVC0_3D_CLEAR_BUFFERS_A; |