st/mesa: fix broken translation of negative register indexes
authorBrian Paul <brianp@vmware.com>
Tue, 5 Jan 2010 18:40:24 +0000 (11:40 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 5 Jan 2010 18:44:19 +0000 (11:44 -0700)
commit9f544394c1d059ce09c8bb2b5e11f5e871c7915f
treed5dc95ad25ecc05040c696811d6f46ce472b6734
parent487a14b476d5e01bd03f50bc45fd3dfc59aa609c
st/mesa: fix broken translation of negative register indexes

A src register's index can be negative if we're doing indirect
addressing into the constant buffer.  Ex: MOV OUT[1], CONST[ADDR[0].x-3]

This fixes the piglit vp-arl-neg-array.vpfp test.

Before this change we were going out of bounds of the t->constants[]
array and getting garbage that later triggered an assertion.
src/mesa/state_tracker/st_mesa_to_tgsi.c