diff options
author | Brian <[email protected]> | 2007-01-09 11:00:21 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-01-09 11:00:21 -0700 |
commit | 21f99792a916a62fcfae7c208f50f192d4ce5926 (patch) | |
tree | 61ceca21090231690b8227bd2f029123c3595962 /src/mesa/main | |
parent | ae80d13f6df1de6628c23635a98f4fcf1c5d34c8 (diff) |
Moved NumTexInstructions, NumTexIndirections, etc. into gl_program since
they can now apply to vertex programs.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 12 | ||||
-rw-r--r-- | src/mesa/main/texenvprogram.c | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f43113a0af4..b6c72055e16 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1871,6 +1871,9 @@ struct gl_program GLuint NumParameters; GLuint NumAttributes; GLuint NumAddressRegs; + GLuint NumAluInstructions; + GLuint NumTexInstructions; + GLuint NumTexIndirections; /*@}*/ /** Native, actual h/w counts */ /*@{*/ @@ -1879,6 +1882,9 @@ struct gl_program GLuint NumNativeParameters; GLuint NumNativeAttributes; GLuint NumNativeAddressRegs; + GLuint NumNativeAluInstructions; + GLuint NumNativeTexInstructions; + GLuint NumNativeTexIndirections; /*@}*/ }; @@ -1897,12 +1903,6 @@ struct gl_vertex_program struct gl_fragment_program { struct gl_program Base; /**< base class */ - GLuint NumAluInstructions; /**< GL_ARB_fragment_program */ - GLuint NumTexInstructions; - GLuint NumTexIndirections; - GLuint NumNativeAluInstructions; /**< GL_ARB_fragment_program */ - GLuint NumNativeTexInstructions; - GLuint NumNativeTexIndirections; GLenum FogOption; GLboolean UsesKill; }; diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index d318a43ebe7..3cb2adbde2e 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -524,7 +524,7 @@ static struct ureg emit_arith( struct texenv_fragment_program *p, if (dest.file == PROGRAM_TEMPORARY) p->alu_temps |= 1 << dest.idx; - p->program->NumAluInstructions++; + p->program->Base.NumAluInstructions++; return dest; } @@ -546,7 +546,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, inst->TexSrcTarget = tex_idx; inst->TexSrcUnit = tex_unit; - p->program->NumTexInstructions++; + p->program->Base.NumTexInstructions++; /* Is this a texture indirection? */ @@ -554,7 +554,7 @@ static struct ureg emit_texld( struct texenv_fragment_program *p, (p->temps_output & (1<<coord.idx))) || (dest.file == PROGRAM_TEMPORARY && (p->alu_temps & (1<<dest.idx)))) { - p->program->NumTexIndirections++; + p->program->Base.NumTexIndirections++; p->temps_output = 1<<coord.idx; p->alu_temps = 0; assert(0); /* KW: texture env crossbar */ @@ -1013,9 +1013,9 @@ create_new_program(GLcontext *ctx, struct state_key *key, */ p.program->Base.Instructions = instBuffer; p.program->Base.Target = GL_FRAGMENT_PROGRAM_ARB; - p.program->NumTexIndirections = 1; /* correct? */ - p.program->NumTexInstructions = 0; - p.program->NumAluInstructions = 0; + p.program->Base.NumTexIndirections = 1; /* correct? */ + p.program->Base.NumTexInstructions = 0; + p.program->Base.NumAluInstructions = 0; p.program->Base.String = 0; p.program->Base.NumInstructions = p.program->Base.NumTemporaries = @@ -1086,13 +1086,13 @@ create_new_program(GLcontext *ctx, struct state_key *key, } else p.program->FogOption = GL_NONE; - if (p.program->NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections) + if (p.program->Base.NumTexIndirections > ctx->Const.FragmentProgram.MaxTexIndirections) program_error(&p, "Exceeded max nr indirect texture lookups"); - if (p.program->NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions) + if (p.program->Base.NumTexInstructions > ctx->Const.FragmentProgram.MaxTexInstructions) program_error(&p, "Exceeded max TEX instructions"); - if (p.program->NumAluInstructions > ctx->Const.FragmentProgram.MaxAluInstructions) + if (p.program->Base.NumAluInstructions > ctx->Const.FragmentProgram.MaxAluInstructions) program_error(&p, "Exceeded max ALU instructions"); ASSERT(p.program->Base.NumInstructions <= MAX_INSTRUCTIONS); |