In debug builds, set clipped vertex window coordinates to NaN values
to help debugging. Otherwise, we're just leaving the coordinate in clip
space and it's invalid to use it later expecting it to be a window coord.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
need_pipeline |= out->clipmask;
}
+ /*
+ * Transform the vertex position from clip coords to window coords,
+ * if the vertex is unclipped.
+ */
if ((flags & DO_VIEWPORT) && mask == 0)
{
/* divide by w */
position[2] = position[2] * w * scale[2] + trans[2];
position[3] = w;
}
+#ifdef DEBUG
+ /* For debug builds, set the clipped vertex's window coordinate
+ * to NaN to help catch potential errors later.
+ */
+ else {
+ position[0] =
+ position[1] =
+ position[2] =
+ position[3] = 0.0f / 0.0f;
+ }
+#endif
if ((flags & DO_EDGEFLAG) && ef) {
const float *edgeflag = out->data[ef];