llvmpipe: clamp color storage for integer types.
authorDave Airlie <airlied@redhat.com>
Tue, 21 Apr 2020 05:28:38 +0000 (15:28 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 27 Apr 2020 02:35:24 +0000 (12:35 +1000)
commit565df656513acec8c2d5fe915c51b4b901265fa7
tree6fcd68f4488d1b50d618c63b8f0582f179f4c1c5
parent024b5dfc1c3eb7255bbec975d57d4002458096bd
llvmpipe: clamp color storage for integer types.

If storing to an integer for lower bit size (i.e. 16-bit uint to
10-bit uint), we need to clamp to the maximum value not truncate.

Fixes:
dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.r16_uint.a2b10g10r10_uint_pack32.optimal_optimal_nearest

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
src/gallium/drivers/llvmpipe/lp_state_fs.c