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/tests/trivial | |
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/tests/trivial')
-rw-r--r-- | src/gallium/tests/trivial/quad-tex.c | 12 | ||||
-rw-r--r-- | src/gallium/tests/trivial/tri.c | 12 |
2 files changed, 12 insertions, 12 deletions
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); diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c index 656e92ee886..d036db80039 100644 --- a/src/gallium/tests/trivial/tri.c +++ b/src/gallium/tests/trivial/tri.c @@ -79,7 +79,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; @@ -98,10 +98,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 */ { @@ -243,7 +243,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); |