i965/vec4: Make with_writemask() non-static.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_clip.c
index de5ff11b41f5366873ddd6f633c90175de6b65ba..95b7d15a4273220a251452fdd2ca39e1742edd2b 100644 (file)
@@ -158,7 +158,8 @@ brw_upload_clip_prog(struct brw_context *brw)
    /* _NEW_LIGHT */
    key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION);
    /* _NEW_TRANSFORM (also part of VUE map)*/
-   key.nr_userclip = _mesa_bitcount_64(ctx->Transform.ClipPlanesEnabled);
+   if (ctx->Transform.ClipPlanesEnabled)
+      key.nr_userclip = _mesa_logbase2(ctx->Transform.ClipPlanesEnabled) + 1;
 
    if (brw->gen == 5)
        key.clip_mode = BRW_CLIPMODE_KERNEL_CLIP;