diff options
author | Brian Paul <[email protected]> | 2005-11-12 17:53:14 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-11-12 17:53:14 +0000 |
commit | de99760bf3511d05185799c4fb4347f9e5f420f4 (patch) | |
tree | a0bda8570a2943b4c7dabc51b7a61e5c5344eded /src/mesa/shader/arbfragparse.c | |
parent | 77ee31930a1b0cc7766939415f4f04ed6a1fa4ac (diff) |
Move stuff common to vertex/fragment_program into the base class, including:
Instructions, InputsRead, OutputsWritten, and Parameters.
Also, added debug functions: _mesa_print_instruction(),
_mesa_print_program_parameters() and revamp _mesa_print_program().
Diffstat (limited to 'src/mesa/shader/arbfragparse.c')
-rw-r--r-- | src/mesa/shader/arbfragparse.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mesa/shader/arbfragparse.c b/src/mesa/shader/arbfragparse.c index 31223cc4737..e6470be9fe7 100644 --- a/src/mesa/shader/arbfragparse.c +++ b/src/mesa/shader/arbfragparse.c @@ -67,31 +67,31 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, } _mesa_memcpy(newInstructions, ap.FPInstructions, ap.Base.NumInstructions * sizeof(struct prog_instruction)); - if (program->Instructions) - _mesa_free(program->Instructions); - program->Instructions = newInstructions; + if (program->Base.Instructions) + _mesa_free(program->Base.Instructions); + program->Base.Instructions = newInstructions; program->Base.String = ap.Base.String; program->Base.NumInstructions = ap.Base.NumInstructions; program->Base.NumTemporaries = ap.Base.NumTemporaries; program->Base.NumParameters = ap.Base.NumParameters; program->Base.NumAttributes = ap.Base.NumAttributes; program->Base.NumAddressRegs = ap.Base.NumAddressRegs; - program->NumAluInstructions = ap.NumAluInstructions; - program->NumTexInstructions = ap.NumTexInstructions; - program->NumTexIndirections = ap.NumTexIndirections; - program->InputsRead = ap.InputsRead; - program->OutputsWritten = ap.OutputsWritten; + program->NumAluInstructions = ap.NumAluInstructions; + program->NumTexInstructions = ap.NumTexInstructions; + program->NumTexIndirections = ap.NumTexIndirections; + program->Base.InputsRead = ap.Base.InputsRead; + program->Base.OutputsWritten = ap.Base.OutputsWritten; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) program->TexturesUsed[i] = ap.TexturesUsed[i]; - if (program->Parameters) { + if (program->Base.Parameters) { /* free previous program's parameters */ - _mesa_free_parameter_list(program->Parameters); + _mesa_free_parameter_list(program->Base.Parameters); } - program->Parameters = ap.Parameters; + program->Base.Parameters = ap.Base.Parameters; program->FogOption = ap.FogOption; #if DEBUG_FP - _mesa_print_program(ap.Base.NumInstructions, ap.FPInstructions); + _mesa_print_program(&program.Base); #endif } |