r300: Removed some checking in r300NumVerts that is not needed.
authorOliver McFadden <z3ro.geek@gmail.com>
Fri, 11 May 2007 19:44:35 +0000 (19:44 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Fri, 11 May 2007 19:45:28 +0000 (19:45 +0000)
According to Aapo Tahkola the OpenGL specification defines the behaviour when
there are not enough vertices for the primitive type, thus DRI drivers do not
need to perform verification on the number of vertices per primitive.

src/mesa/drivers/dri/r300/r300_render.c

index d49d218a8eb2f65f4563d45ea9b43bddbc86e53c..5249aa2137dd7cb0874b99a7ed1d94d090014120 100644 (file)
@@ -172,20 +172,6 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim)
                break;
        }
 
-       if (num_verts - verts_off == 0) {
-               WARN_ONCE
-                   ("user error: Need more than %d vertices to draw primitive 0x%04x !\n",
-                    num_verts, prim & PRIM_MODE_MASK);
-               return -1;
-       }
-
-       if (verts_off > 0) {
-               WARN_ONCE
-                   ("user error: %d is not a valid number of vertices for primitive 0x%04x !\n",
-                    num_verts, prim & PRIM_MODE_MASK);
-               return -1;
-       }
-
        return num_verts - verts_off;
 }
 
@@ -259,7 +245,6 @@ static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts,
                rvb->aos_offset =
                    rmesa->radeon.radeonScreen->gart_texture_offset +
                    rvb->start;
-
                return;
        } else if (r300IsGartMemory(rmesa, elts, 1)) {
                WARN_ONCE("Pointer not within GART memory!\n");