Merge remote branch 'origin/mesa_7_6_branch'
[mesa.git] / src / mesa / tnl / t_vb_program.c
index 66c5e13729c1c1dc0ebb42da7cfa54fca34dd508..c10a27614ff9e15249155211016ea9080e38b6c2 100644 (file)
@@ -131,13 +131,16 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store)
    store->ormask = 0;
    store->andmask = CLIP_FRUSTUM_BITS;
 
+   tnl_clip_prepare(ctx);
+
    if (tnl->NeedNdcCoords) {
       VB->NdcPtr =
          _mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
                                             &store->ndcCoords,
                                             store->clipmask,
                                             &store->ormask,
-                                            &store->andmask );
+                                            &store->andmask,
+                                           !ctx->Transform.DepthClamp );
    }
    else {
       VB->NdcPtr = NULL;
@@ -145,7 +148,8 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store)
                                             NULL,
                                             store->clipmask,
                                             &store->ormask,
-                                            &store->andmask );
+                                            &store->andmask,
+                                           !ctx->Transform.DepthClamp );
    }
 
    if (store->andmask) {
@@ -386,6 +390,9 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
 #endif
          COPY_4V(store->results[attr].data[i], machine.Outputs[attr]);
       }
+#ifdef NAN_CHECK
+      ASSERT(machine.Outputs[0][3] != 0.0F);
+#endif
 #if 0
       printf("HPOS: %f %f %f %f\n",
              machine.Outputs[0][0],