ctx->Const.MaxLineWidthAA = 3.0;
ctx->Const.LineWidthGranularity = 1.0;
#endif
- /* This is needed to get polygon offset right with reversed depth range
- * (see savageCalcViewport). Not sure if it has any other side effects. */
- ctx->MRD *= -1.0;
/* Dri stuff
*/
#define TAB rast_tab
#define DEPTH_SCALE imesa->depth_scale
+#define REVERSE_DEPTH 1
#define UNFILLED_TRI unfilled_tri
#define UNFILLED_QUAD unfilled_quad
#define VERT_X(_v) _v->v.x
* VERT_X(v): Alias for vertex x value.
* VERT_Y(v): Alias for vertex y value.
* VERT_Z(v): Alias for vertex z value.
- * DEPTH_SCALE: Scale for offset.
+ * DEPTH_SCALE: Scale for constant offset.
+ * REVERSE_DEPTH: Viewport depth range reversed.
*
* VERTEX: Hardware vertex type.
* GET_VERTEX(n): Retreive vertex with index n.
#define VERT_Z_ADD(v,val) VERT_Z(v) += val
#endif
+#ifndef REVERSE_DEPTH
+#define REVERSE_DEPTH 0
+#endif
+
/* disable twostencil for un-aware drivers */
#ifndef HAVE_STENCIL_TWOSIDE
#define HAVE_STENCIL_TWOSIDE 0
if ( bc < 0.0f ) bc = -bc;
offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor;
}
- offset *= ctx->MRD;
+ offset *= REVERSE_DEPTH ? -ctx->MRD : ctx->MRD;
}
}
if ( bc < 0.0f ) bc = -bc;
offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor;
}
- offset *= ctx->MRD;
+ offset *= REVERSE_DEPTH ? -ctx->MRD : ctx->MRD;
}
}