diff options
author | Hans de Goede <j.w..r..degoede@hhs.nl> | 2008-01-02 01:29:51 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-01-02 01:29:51 +1000 |
commit | 2290ea7fe694dd74a88f4480326e9470fb9e945e (patch) | |
tree | 100fc7d3c6e2bb962c3f0c1f6283a402eb3528fd /src/mesa/drivers/dri/r300 | |
parent | cc50edbca2fd3111f9987d4117fa6656599d79dc (diff) |
rx00: fix off by one error in tempreg check
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertprog.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 4dd3fd6a67..e6f216e403 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -101,8 +101,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define FREE_TEMPS() \ do { \ - if(u_temp_i < vp->num_temporaries) { \ - WARN_ONCE("Ran out of temps, num temps %d, us %d\n", vp->num_temporaries, u_temp_i); \ + int u_temp_used = (VSF_MAX_FRAGMENT_TEMPS - 1) - u_temp_i; \ + if((vp->num_temporaries + u_temp_used) > VSF_MAX_FRAGMENT_TEMPS) { \ + WARN_ONCE("Ran out of temps, num temps %d, us %d\n", vp->num_temporaries, u_temp_used); \ vp->native = GL_FALSE; \ } \ u_temp_i=VSF_MAX_FRAGMENT_TEMPS-1; \ |