Cope with internally-generated null inputs.
authorKeith Whitwell <keith@tungstengraphics.com>
Thu, 1 Feb 2007 14:20:31 +0000 (14:20 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Thu, 1 Feb 2007 14:20:31 +0000 (14:20 +0000)
src/mesa/drivers/dri/i965/brw_draw.c

index 7d8f837093ac7bdf43176ee8b867b69a5cc91af5..092c6bafc2d155d449ee03f564142fa9beaceef6 100644 (file)
@@ -183,10 +183,13 @@ static void brw_merge_inputs( struct brw_context *brw,
    for (i = 0; i < VERT_ATTRIB_MAX; i++) {
       brw->vb.inputs[i].glarray = arrays[i];
 
-      if (arrays[i]->StrideB != 0)
-        brw->vb.info.varying |= 1 << i;
+      /* XXX: metaops passes null arrays */
+      if (arrays[i]) {
+        if (arrays[i]->StrideB != 0)
+           brw->vb.info.varying |= 1 << i;
 
-      brw->vb.info.sizes[i/16] |= (inputs[i].glarray->Size - 1) << ((i%16) * 2);
+        brw->vb.info.sizes[i/16] |= (inputs[i].glarray->Size - 1) << ((i%16) * 2);
+      }
    }
 
    /* Raise statechanges if input sizes and varying have changed: