diff options
author | Roland Scheidegger <[email protected]> | 2013-02-27 19:26:01 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-02-28 03:39:54 +0100 |
commit | 686f6c69bd36c537573f6e8095aaf24ec0ae4047 (patch) | |
tree | 96da10fcfbfb255330ef0e2a28610b2cea96a1e5 /src/gallium/drivers/llvmpipe/lp_rast.c | |
parent | 2fcd3638be9526e0300964894e93fd4082fb6fdb (diff) |
llvmpipe: support rendering to buffer render targets.
Unfortunately not usable from OpenGL, and no cap bit.
Pretty similar to a 1d texture, though allows specifying a start element.
v2: also fix up renderbuffer width (which will get promoted to fb width)
to be the number of elements
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index b5e5da61c2a..6183f4108d6 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -165,32 +165,13 @@ lp_rast_clear_color(struct lp_rasterizer_task *task, for (i = 0; i < scene->fb.nr_cbufs; i++) { enum pipe_format format = scene->fb.cbufs[i]->format; - /* - * XXX the format_write_4i/ui functions do clamping to max value - * and I'm not sure that's actually right - spec doesn't seem to - * say much about that topic. If it is should probably adjust the - * border color handling to do the same. If not and chopping off - * bits is the way to go, the write_4i and write_4ui functions - * would be identical. - */ - if (util_format_is_pure_sint(format)) { - int rgba[4]; - rgba[0] = arg.clear_color.i[0]; - rgba[1] = arg.clear_color.i[1]; - rgba[2] = arg.clear_color.i[2]; - rgba[3] = arg.clear_color.i[3]; - util_format_write_4i(format, rgba, 0, &uc, 0, 0, 0, 1, 1); + if (util_format_is_pure_sint(format)) { + util_format_write_4i(format, arg.clear_color.i, 0, &uc, 0, 0, 0, 1, 1); } else { - unsigned rgba[4]; - rgba[0] = arg.clear_color.ui[0]; - rgba[1] = arg.clear_color.ui[1]; - rgba[2] = arg.clear_color.ui[2]; - rgba[3] = arg.clear_color.ui[3]; - assert(util_format_is_pure_uint(format)); - util_format_write_4ui(format, rgba, 0, &uc, 0, 0, 0, 1, 1); + util_format_write_4ui(format, arg.clear_color.ui, 0, &uc, 0, 0, 0, 1, 1); } util_fill_rect(scene->cbufs[i].map, |