The old logic would let all negative values go through unclamped, with
potentially disastrous results (probably trying to fetch viewport values
from random memory locations). GL has undefined rendering for vp indices
outside valid range but that's a bit too undefined...
(The logic is now the same as in llvmpipe.)
CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
static INLINE unsigned
draw_clamp_viewport_idx(int idx)
{
- return ((PIPE_MAX_VIEWPORTS > idx || idx < 0) ? idx : 0);
+ return ((PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0);
}
/**