diff options
author | Roland Scheidegger <[email protected]> | 2013-01-10 18:10:20 -0800 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-01-10 18:10:20 -0800 |
commit | babab2876080af0fe65249dff559244aebd0b87e (patch) | |
tree | f4d44a31ed1a35ba76001c57695947985daa9f1e /src/gallium/drivers/llvmpipe/lp_setup.c | |
parent | 5785f22d230bc7249dfcd91bbbaa4e77816128e4 (diff) |
llvmpipe: fix clearing integer color buffers
We get int/uint clear color value in this case, and util_pack_color can't
handle these formats at all (even if it could, float input color isn't what
we want).
Pass through the color union appropriately and handle the packing ourselves
(as I couldn't think of a good generic util solution).
This gets piglit fbo_integer_precision_clear and
fbo_integer_readpixels_sint_uint from the ext_texture_integer test group from
segfault to pass (which only leaves fbo-blending from that group not working).
v2: fix up comments
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 5aba7a25342..ffa0fe6eaa3 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -385,7 +385,7 @@ lp_setup_bind_framebuffer( struct lp_setup_context *setup, static boolean lp_setup_try_clear( struct lp_setup_context *setup, - const float *color, + const union pipe_color_union *color, double depth, unsigned stencil, unsigned flags ) @@ -399,7 +399,7 @@ lp_setup_try_clear( struct lp_setup_context *setup, if (flags & PIPE_CLEAR_COLOR) { for (i = 0; i < 4; i++) - color_arg.clear_color[i] = color[i]; + color_arg.clear_color.i[i] = color->i[i]; } if (flags & PIPE_CLEAR_DEPTHSTENCIL) { @@ -458,7 +458,7 @@ lp_setup_try_clear( struct lp_setup_context *setup, } if (flags & PIPE_CLEAR_COLOR) { - memcpy(setup->clear.color.clear_color, + memcpy(&setup->clear.color.clear_color, &color_arg, sizeof setup->clear.color.clear_color); } @@ -469,7 +469,7 @@ lp_setup_try_clear( struct lp_setup_context *setup, void lp_setup_clear( struct lp_setup_context *setup, - const float *color, + const union pipe_color_union *color, double depth, unsigned stencil, unsigned flags ) |