st/mesa: add missing case for PIPE_FORMAT_B8G8R8A8_UNORM
[mesa.git] / src / mesa / tnl / t_vb_program.c
index 66c5e13729c1c1dc0ebb42da7cfa54fca34dd508..e69f7d5766466908f93e89200d97bd7f8939989c 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) {
@@ -325,7 +329,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
    /* make list of outputs to save some time below */
    numOutputs = 0;
    for (i = 0; i < VERT_RESULT_MAX; i++) {
-      if (program->Base.OutputsWritten & (1 << i)) {
+      if (program->Base.OutputsWritten & BITFIELD64_BIT(i)) {
          outputs[numOutputs++] = i;
       }
    }
@@ -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], 
@@ -400,14 +407,14 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
    /* Fixup fog and point size results if needed */
    if (program->IsNVProgram) {
       if (ctx->Fog.Enabled &&
-          (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) {
+          (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) {
          for (i = 0; i < VB->Count; i++) {
             store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
          }
       }
 
       if (ctx->VertexProgram.PointSizeEnabled &&
-          (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) {
+          (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
          for (i = 0; i < VB->Count; i++) {
             store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
          }
@@ -465,7 +472,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
    }
 
    for (i = 0; i < ctx->Const.MaxVarying; i++) {
-      if (program->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) {
+      if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) {
          /* Note: varying results get put into the generic attributes */
         VB->AttribPtr[VERT_ATTRIB_GENERIC0+i]
             = &store->results[VERT_RESULT_VAR0 + i];