mesa/st: Add checks for signed/unsigned integer conversions in ReadPixels
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 29 Jun 2015 08:44:52 +0000 (10:44 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 2 Jul 2015 06:15:51 +0000 (08:15 +0200)
commit9d408a41a3ab2fe456ebf2f7af7bad8f6c4bca17
tree8efc480af45dd2976e2e61924749dd939f3c2c69
parentc3215ef204c0fdfc44230adbd423720169d44dcb
mesa/st: Add checks for signed/unsigned integer conversions in ReadPixels

These checks were in Mesa prior to commit fbba25bba, but they were
not necessary for the purpose that Mesa intended (check if we could
resolve ReadPixels via memcpy), so that commit took them away.

Unfortunately, it seems that some Gallium drivers rely on these
checks to make the decision of whether they should fallback to Mesa's
implementation of ReadPixels correctly. Michel Dänzer reported that
the following piglit test would fail on radeonsi after commit
fbba25bba:

spec@ext_texture_integer@fbo_integer_readpixels_sint_uint

This patch puts the checks back in Gallium, where they are needed.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
src/mesa/state_tracker/st_cb_readpixels.c