st/mesa: Enable clip planes lowering for geometry shaders
[mesa.git] / src / mesa / state_tracker / st_atom_shader.c
index b349c2a1f17eb637f300e254be86a9e44fcb14da..d92a542922e69e174df8ecc5cf778b37acaa8764 100644 (file)
@@ -228,7 +228,8 @@ st_update_vp( struct st_context *st )
                              !st_point_size_per_vertex(st->ctx);
 
       /* _NEW_TRANSFORM */
-      if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx))
+      if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx) &&
+          !st->ctx->GeometryProgram._Current)
          key.lower_ucp = st->ctx->Transform.ClipPlanesEnabled;
 
       st->vp_variant = st_get_vp_variant(st, stvp, &key);
@@ -285,6 +286,9 @@ st_update_common_program(struct st_context *st, struct gl_program *prog,
          key.clip_negative_one_to_one =
                st->ctx->Transform.ClipDepthMode == GL_NEGATIVE_ONE_TO_ONE;
 
+      if (st->lower_ucp && st_user_clip_planes_enabled(st->ctx) &&
+          pipe_shader == PIPE_SHADER_GEOMETRY)
+         key.lower_ucp = st->ctx->Transform.ClipPlanesEnabled;
    }
 
    return st_get_common_variant(st, stp, &key)->driver_shader;