r300: Clean up the vertex program maximum length check.
authorOliver McFadden <z3ro.geek@gmail.com>
Mon, 16 Jul 2007 06:33:53 +0000 (06:33 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Mon, 16 Jul 2007 06:33:53 +0000 (06:33 +0000)
src/mesa/drivers/dri/r300/r300_vertprog.c

index 9c125136083c4fa2676ea6140f02d354a492fb73..1fea88a85397af57fc8ecb659c4d4d62c941b26d 100644 (file)
@@ -1126,13 +1126,11 @@ static void r300TranslateVertexShader(struct r300_vertex_program *vp,
                }
        }
 
-       /* Will most likely segfault before we get here... fix later. */
-       if (o_inst - vp->program.body.i >= VSF_MAX_FRAGMENT_LENGTH / 4) {
+       vp->program.length = (o_inst - vp->program.body.i) * 4;
+       if (vp->program.length >= VSF_MAX_FRAGMENT_LENGTH) {
                vp->program.length = 0;
                vp->native = GL_FALSE;
-               return;
        }
-       vp->program.length = (o_inst - vp->program.body.i) * 4;
 
 #if 0
        fprintf(stderr, "hw program:\n");