rastState->slopeScaledDepthBias = 0;
rastState->depthBiasClamp = 0;
}
+
+ /* translate polygon mode, at least for the front==back case */
+ rastState->fillMode = swr_convert_fill_mode(rasterizer->fill_front);
+
struct pipe_surface *zb = fb->zsbuf;
if (zb && swr_resource(zb->texture)->has_depth)
rastState->depthFormat = swr_resource(zb->texture)->swr.format;
/* and points, since we rasterize them as triangles, too */
/* Has to be before fragment shader, since it sets SWR_NEW_FS */
if (p_draw_info) {
- bool new_prim_is_poly = (u_reduced_prim(p_draw_info->mode) == PIPE_PRIM_TRIANGLES);
+ bool new_prim_is_poly =
+ (u_reduced_prim(p_draw_info->mode) == PIPE_PRIM_TRIANGLES) &&
+ (ctx->derived.rastState.fillMode == SWR_FILLMODE_SOLID);
if (new_prim_is_poly != ctx->poly_stipple.prim_is_poly) {
ctx->dirty |= SWR_NEW_FS;
ctx->poly_stipple.prim_is_poly = new_prim_is_poly;
return TOP_UNKNOWN;
}
};
+
+/*
+ * convert mesa PIPE_POLYGON_MODE_X to SWR enum SWR_FILLMODE
+ */
+static INLINE enum SWR_FILLMODE
+swr_convert_fill_mode(const unsigned mode)
+{
+ switch(mode) {
+ case PIPE_POLYGON_MODE_FILL:
+ return SWR_FILLMODE_SOLID;
+ case PIPE_POLYGON_MODE_LINE:
+ return SWR_FILLMODE_WIREFRAME;
+ case PIPE_POLYGON_MODE_POINT:
+ return SWR_FILLMODE_POINT;
+ default:
+ assert(0 && "Unknown fillmode");
+ return SWR_FILLMODE_SOLID; // at least do something sensible
+ }
+}
+
#endif