summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorHans de Goede <j.w..r..degoede@hhs.nl>2008-01-02 01:29:51 +1000
committerDave Airlie <airlied@linux.ie>2008-01-02 01:29:51 +1000
commit2290ea7fe694dd74a88f4480326e9470fb9e945e (patch)
tree100fc7d3c6e2bb962c3f0c1f6283a402eb3528fd /src/mesa/drivers/dri/r200
parentcc50edbca2fd3111f9987d4117fa6656599d79dc (diff)
downloadexternal_mesa3d-2290ea7fe694dd74a88f4480326e9470fb9e945e.zip
external_mesa3d-2290ea7fe694dd74a88f4480326e9470fb9e945e.tar.gz
external_mesa3d-2290ea7fe694dd74a88f4480326e9470fb9e945e.tar.bz2
rx00: fix off by one error in tempreg check
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 604b9c6..7fba6c7 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -408,6 +408,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
int fog_temp_i = 0;
int free_inputs;
int array_count = 0;
+ int u_temp_used;
vp->native = GL_FALSE;
vp->translated = GL_TRUE;
@@ -1051,14 +1052,15 @@ else {
dofogfix = 0;
}
+ u_temp_used = (R200_VSF_MAX_TEMPS - 1) - u_temp_i;
if (mesa_vp->Base.NumNativeTemporaries <
- (mesa_vp->Base.NumTemporaries + (R200_VSF_MAX_TEMPS - 1 - u_temp_i))) {
+ (mesa_vp->Base.NumTemporaries + u_temp_used)) {
mesa_vp->Base.NumNativeTemporaries =
- mesa_vp->Base.NumTemporaries + (R200_VSF_MAX_TEMPS - 1 - u_temp_i);
+ mesa_vp->Base.NumTemporaries + u_temp_used;
}
- if (u_temp_i < mesa_vp->Base.NumTemporaries) {
+ if ((mesa_vp->Base.NumTemporaries + u_temp_used) > R200_VSF_MAX_TEMPS) {
if (R200_DEBUG & DEBUG_FALLBACKS) {
- fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->Base.NumTemporaries, u_temp_i);
+ fprintf(stderr, "Ran out of temps, num temps %d, us %d\n", mesa_vp->Base.NumTemporaries, u_temp_used);
}
return GL_FALSE;
}