diff options
author | Lucas Stach <[email protected]> | 2017-09-22 11:24:08 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-09-22 20:48:32 +0200 |
commit | e9d37d68cff2ac871d8e32a947173898683c0af3 (patch) | |
tree | 3dd546f1dcdd7935693160b51a2ee1d196b394b4 | |
parent | 066d1dc951d3a0833de6abd8e004bf467e6e50eb (diff) |
etnaviv: fix 16bpp clears
util_pack_color may leave undefined values in the upper half of the packed
integer. As our hardware needs the upper 16 bits to mirror the lower 16bits,
this breaks clears of those formats if the undefined values aren't masked off.
I've only observed the issue with R5G6B5_UNORM surfaces, other 16bpp
formats seem to work fine.
Fixes: d6aa2ba2b2 (etnaviv: replace translate_clear_color with util_pack_color)
Cc: [email protected]
Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_clear_blit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c index 92c91073434..d73d0e30b3e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c @@ -106,7 +106,7 @@ pack_rgba(enum pipe_format format, const float *rgba) union util_color uc; util_pack_color(rgba, format, &uc); if (util_format_get_blocksize(format) == 2) - return uc.ui[0] << 16 | uc.ui[0]; + return uc.ui[0] << 16 | (uc.ui[0] & 0xffff); else return uc.ui[0]; } |