From 6dd284f7c8fac22f64c13fdf9909094f5ec59086 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 16 Sep 2011 09:39:34 +0100 Subject: 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 --- src/gallium/tests/trivial/quad-tex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gallium/tests/trivial/quad-tex.c') diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c index 6c38b1096c1..79c66e0e67e 100644 --- a/src/gallium/tests/trivial/quad-tex.c +++ b/src/gallium/tests/trivial/quad-tex.c @@ -82,7 +82,7 @@ struct program void *vs; void *fs; - float clear_color[4]; + union pipe_color_union clear_color; struct pipe_resource *vbuf; struct pipe_resource *target; @@ -103,10 +103,10 @@ static void init_prog(struct program *p) p->cso = cso_create_context(p->pipe); /* set clear color */ - p->clear_color[0] = 0.3; - p->clear_color[1] = 0.1; - p->clear_color[2] = 0.3; - p->clear_color[3] = 1.0; + p->clear_color.f[0] = 0.3; + p->clear_color.f[1] = 0.1; + p->clear_color.f[2] = 0.3; + p->clear_color.f[3] = 1.0; /* vertex buffer */ { @@ -307,7 +307,7 @@ static void draw(struct program *p) cso_set_framebuffer(p->cso, &p->framebuffer); /* clear the render target */ - p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, p->clear_color, 0, 0); + p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, &p->clear_color, 0, 0); /* set misc state we care about */ cso_set_blend(p->cso, &p->blend); -- cgit v1.2.3