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/r300/r300_render.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/r300/r300_render.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_render.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index d69b4cf4275..fc3ba335886 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -1186,7 +1186,7 @@ static void r300_blitter_draw_rectangle(struct blitter_context *blitter, unsigned x2, unsigned y2, float depth, enum blitter_attrib_type type, - const float attrib[4]) + const union pipe_color_union *attrib) { struct r300_context *r300 = r300_context(util_blitter_get_pipe(blitter)); unsigned last_sprite_coord_enable = r300->sprite_coord_enable; @@ -1196,7 +1196,7 @@ static void r300_blitter_draw_rectangle(struct blitter_context *blitter, type == UTIL_BLITTER_ATTRIB_COLOR || !r300->draw ? 8 : 4; unsigned dwords = 13 + vertex_size + (type == UTIL_BLITTER_ATTRIB_TEXCOORD ? 7 : 0); - const float zeros[4] = {0, 0, 0, 0}; + static const union pipe_color_union zeros; CS_LOCALS(r300); if (r300->skip_rendering) @@ -1227,10 +1227,10 @@ static void r300_blitter_draw_rectangle(struct blitter_context *blitter, OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE | (R300_GB_TEX_STR << R300_GB_TEX0_SOURCE_SHIFT)); OUT_CS_REG_SEQ(R300_GA_POINT_S0, 4); - OUT_CS_32F(attrib[0]); - OUT_CS_32F(attrib[3]); - OUT_CS_32F(attrib[2]); - OUT_CS_32F(attrib[1]); + OUT_CS_32F(attrib->f[0]); + OUT_CS_32F(attrib->f[3]); + OUT_CS_32F(attrib->f[2]); + OUT_CS_32F(attrib->f[1]); } /* Set up VAP controls. */ @@ -1253,8 +1253,8 @@ static void r300_blitter_draw_rectangle(struct blitter_context *blitter, if (vertex_size == 8) { if (!attrib) - attrib = zeros; - OUT_CS_TABLE(attrib, 4); + attrib = &zeros; + OUT_CS_TABLE(attrib->f, 4); } END_CS; @@ -1273,7 +1273,7 @@ static void r300_resource_resolve(struct pipe_context *pipe, struct r300_context *r300 = r300_context(pipe); struct pipe_surface *srcsurf, *dstsurf, surf_tmpl; struct r300_aa_state *aa = (struct r300_aa_state*)r300->aa_state.state; - float color[] = {0, 0, 0, 0}; + static const union pipe_color_union color; memset(&surf_tmpl, 0, sizeof(surf_tmpl)); surf_tmpl.format = info->src.res->format; @@ -1301,7 +1301,7 @@ static void r300_resource_resolve(struct pipe_context *pipe, /* Resolve the surface. */ /* XXX: y1 < 0 ==> Y flip */ r300->context.clear_render_target(pipe, - srcsurf, color, 0, 0, + srcsurf, &color, 0, 0, info->dst.x1 - info->dst.x0, info->dst.y1 - info->dst.y0); |