nvc0: don't upload UCPs if the shader doesn't use them
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 26 May 2012 11:54:55 +0000 (13:54 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 29 May 2012 15:00:15 +0000 (17:00 +0200)
src/gallium/drivers/nvc0/nvc0_state_validate.c

index e35aae5..0f92614 100644 (file)
@@ -308,7 +308,7 @@ nvc0_validate_clip(struct nvc0_context *nvc0)
       nvc0_check_program_ucps(nvc0, vp, clip_enable);
 
    if (nvc0->dirty & (NVC0_NEW_CLIP | (NVC0_NEW_VERTPROG << stage)))
-      if (vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES)
+      if (vp->vp.num_ucps > 0 && vp->vp.num_ucps <= PIPE_MAX_CLIP_PLANES)
          nvc0_upload_uclip_planes(nvc0, stage);
 
    clip_enable &= vp->vp.clip_enable;