draw: (trivial) fix clamping of viewport index
authorRoland Scheidegger <sroland@vmware.com>
Mon, 23 Jun 2014 20:06:15 +0000 (22:06 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Mon, 23 Jun 2014 22:37:52 +0000 (00:37 +0200)
commit604e54de78aa00430b1d61d030656e387866e840
tree1f03640a27b608674352f36c7d237a60105c8e47
parentf6a99d1167b14a3ada7c1d6f41a5cc6f13290e0d
draw: (trivial) fix clamping of viewport index

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>
src/gallium/auxiliary/draw/draw_private.h