+/*
+ * Try to allocate an output slot which we can use
+ * to preserve the front face information.
+ */
+void
+draw_unfilled_prepare_outputs( struct draw_context *draw,
+ struct draw_stage *stage )
+{
+ struct unfilled_stage *unfilled = unfilled_stage(stage);
+ const struct pipe_rasterizer_state *rast = draw ? draw->rasterizer : 0;
+ boolean is_unfilled = (rast &&
+ (rast->fill_front != PIPE_POLYGON_MODE_FILL ||
+ rast->fill_back != PIPE_POLYGON_MODE_FILL));
+ const struct draw_fragment_shader *fs = draw->fs.fragment_shader;
+
+ if (is_unfilled && fs && fs->info.uses_frontface) {
+ unfilled->face_slot = draw_alloc_extra_vertex_attrib(
+ stage->draw, TGSI_SEMANTIC_FACE, 0);
+ } else {
+ unfilled->face_slot = -1;
+ }
+}
+