st/mesa: fix SINT <-> UINT conversion during PBO upload / download
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 7 Nov 2016 17:12:08 +0000 (18:12 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 16 Nov 2016 09:31:31 +0000 (10:31 +0100)
commit7cdf292dc3a83ff8d6cb26fc15a679d6d2cdc25b
tree8d36003b86e92707cc45409e7408b44dec599ef3
parent5e10a3d6e5c26ecfb536707165f4baf3b27a7623
st/mesa: fix SINT <-> UINT conversion during PBO upload / download

This fixes use cases like glReadPixels from an RGBA8I framebuffer into
a PBO with type GL_INT by clamping values appropriately when they fall
outside the range of the destination format.

Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pbo.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_pbo.c
src/mesa/state_tracker/st_pbo.h