i965: fix vb aperture space check
authorDave Airlie <airlied@panoply-rh.(none)>
Fri, 18 Apr 2008 05:14:48 +0000 (15:14 +1000)
committerDave Airlie <airlied@panoply-rh.(none)>
Fri, 18 Apr 2008 05:14:48 +0000 (15:14 +1000)
src/mesa/drivers/dri/i965/brw_draw_upload.c

index 78677df6c0afc2c99942a771577d051f0b48b64c..aa985d68b69c1c6892e024eba1a78b60900897cc 100644 (file)
@@ -315,7 +315,7 @@ int brw_prepare_vertices( struct brw_context *brw,
    GLuint i;
    const unsigned char *ptr = NULL;
    GLuint interleave = 0;
-   int ret;
+   int ret = 0;
 
    struct brw_vertex_element *enabled[VERT_ATTRIB_MAX];
    GLuint nr_enabled = 0;
@@ -362,6 +362,8 @@ int brw_prepare_vertices( struct brw_context *brw,
         dri_bo_reference(input->bo);
         input->offset = (unsigned long)input->glarray->Ptr;
         input->stride = input->glarray->StrideB;
+
+        ret |= dri_bufmgr_check_aperture_space(input->bo);
       } else {
         /* Queue the buffer object up to be uploaded in the next pass,
          * when we've decided if we're doing interleaved or not.
@@ -419,11 +421,13 @@ int brw_prepare_vertices( struct brw_context *brw,
    }
 
    if (brw->vb.upload.bo) {
-     ret = dri_bufmgr_check_aperture_space(brw->vb.upload.bo);
-     if (ret)
-       return 1;
+     ret |= dri_bufmgr_check_aperture_space(brw->vb.upload.bo);
    }
 
+   if (ret)
+     return 1;
+
+
    return 0;
 }