intel: Transition intel_region_map() to being a miptree operation.
[mesa.git] / src / mesa / tnl / t_vb_program.c
index 74772dbbe537ac8f08fbce9f0ff95e38d2479066..8ff300cd7f5bb5b3df886867d51d56046511f5b3 100644 (file)
@@ -231,21 +231,6 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
    memcpy(machine->VertAttribs, ctx->Current.Attrib,
           MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
 
-   if (ctx->VertexProgram._Current->IsNVProgram) {
-      GLuint i;
-      /* Output/result regs are initialized to [0,0,0,1] */
-      for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
-         ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
-      }
-      /* Temp regs are initialized to [0,0,0,0] */
-      for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
-         ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
-      }
-      for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) {
-         ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0);
-      }
-   }
-
    machine->NumDeriv = 0;
 
    /* init condition codes */
@@ -321,13 +306,8 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
    if (!program)
       return GL_TRUE;
 
-   if (program->IsNVProgram) {
-      _mesa_load_tracked_matrices(ctx);
-   }
-   else {
-      /* ARB program or vertex shader */
-      _mesa_load_state_parameters(ctx, program->Base.Parameters);
-   }
+   /* ARB program or vertex shader */
+   _mesa_load_state_parameters(ctx, program->Base.Parameters);
 
    /* make list of outputs to save some time below */
    numOutputs = 0;
@@ -425,23 +405,6 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
 
    unmap_textures(ctx, program);
 
-   /* Fixup fog and point size results if needed */
-   if (program->IsNVProgram) {
-      if (ctx->Fog.Enabled &&
-          (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 & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
-         for (i = 0; i < VB->Count; i++) {
-            store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
-         }
-      }
-   }
-
    if (program->IsPositionInvariant) {
       /* We need the exact same transform as in the fixed function path here
        * to guarantee invariance, depending on compiler optimization flags
@@ -514,14 +477,14 @@ init_vp(struct gl_context *ctx, struct tnl_pipeline_stage *stage)
    struct vp_stage_data *store;
    const GLuint size = VB->Size;
 
-   stage->privatePtr = CALLOC(sizeof(*store));
+   stage->privatePtr = calloc(1, sizeof(*store));
    store = VP_STAGE_DATA(stage);
    if (!store)
       return GL_FALSE;
 
    /* a few other misc allocations */
    _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 );
-   store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
+   store->clipmask = _mesa_align_malloc(sizeof(GLubyte)*size, 32 );
 
    return GL_TRUE;
 }
@@ -546,7 +509,7 @@ dtr(struct tnl_pipeline_stage *stage)
       _mesa_vector4f_free( &store->ndcCoords );
       _mesa_align_free( store->clipmask );
 
-      FREE( store );
+      free( store );
       stage->privatePtr = NULL;
    }
 }