Fix Windows newlines.
[mesa.git] / src / mesa / shader / nvvertexec.c
index 5bb40d881e007b4fcf1b769e4349d76ec0520d25..c436f4f04511f64391c820c9c7fcbf97f40d7f04 100644 (file)
@@ -2,7 +2,7 @@
  * Mesa 3-D graphics library
  * Version:  6.5
  *
- * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -51,7 +51,7 @@ _mesa_init_vp_per_vertex_registers(GLcontext *ctx)
 {
    /* Input registers get initialized from the current vertex attribs */
    MEMCPY(ctx->VertexProgram.Inputs, ctx->Current.Attrib,
-          VERT_ATTRIB_MAX * 4 * sizeof(GLfloat));
+          MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat));
 
    if (ctx->VertexProgram.Current->IsNVProgram) {
       GLuint i;
@@ -162,10 +162,10 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx)
    }
    else {
       /* Using and ARB vertex program */
-      if (ctx->VertexProgram.Current->Parameters) {
+      if (ctx->VertexProgram.Current->Base.Parameters) {
          /* Grab the state GL state and put into registers */
          _mesa_load_state_parameters(ctx,
-                                     ctx->VertexProgram.Current->Parameters);
+                                 ctx->VertexProgram.Current->Base.Parameters);
       }
    }
 }
@@ -239,7 +239,7 @@ get_register_pointer( const struct prog_src_register *source,
       else if (source->File == PROGRAM_ENV_PARAM)
          return state->Parameters[reg];
       else
-         return state->Current->Parameters->ParameterValues[reg];
+         return state->Current->Base.Parameters->ParameterValues[reg];
    }
    else {
       switch (source->File) {
@@ -260,8 +260,8 @@ get_register_pointer( const struct prog_src_register *source,
             ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_PARAMS);
             return state->Parameters[source->Index];
          case PROGRAM_STATE_VAR:
-            ASSERT(source->Index < state->Current->Parameters->NumParameters);
-            return state->Current->Parameters->ParameterValues[source->Index];
+            ASSERT(source->Index < state->Current->Base.Parameters->NumParameters);
+            return state->Current->Base.Parameters->ParameterValues[source->Index];
          default:
             _mesa_problem(NULL,
                           "Bad source register file in get_register_pointer");
@@ -379,7 +379,7 @@ store_vector4( const struct prog_dst_register *dest,
  * Execute the given vertex program
  */
 void
-_mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program)
+_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program)
 {
    struct gl_vertex_program_state *state = &ctx->VertexProgram;
    const struct prog_instruction *inst;
@@ -395,9 +395,10 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program)
                        ctx->VertexProgram.Inputs[VERT_ATTRIB_POS]);
 
       /* XXX: This could go elsewhere */
-      ctx->VertexProgram.Current->OutputsWritten |= VERT_BIT_POS;
+      ctx->VertexProgram.Current->Base.OutputsWritten |= VERT_BIT_POS;
    }
-   for (inst = program->Instructions; ; inst++) {
+
+   for (inst = program->Base.Instructions; ; inst++) {
 
       if (ctx->VertexProgram.CallbackEnabled &&
           ctx->VertexProgram.Callback) {