diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-11-01 04:36:33 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-11-01 04:36:33 +0000 |
commit | 05051037101dfa053798cf5ad91d1975fd1aa6a7 (patch) | |
tree | 0cf21bc55a1c006a6f7fa99d7613e73428598fee /src/mesa/drivers/dri/i915/i915_program.c | |
parent | ffec105109f5b16bfe8282bd477d4aa32b550015 (diff) |
Re-org and clean-up of vertx/fragment program limits (instructions,
temporaries, parameters, etc).
glGetProgramivARB() now returns all the right things.
Updated i915 and r300 code to initialize program native limits and
current program's native instruction/temporary/etc counts.
Diffstat (limited to 'src/mesa/drivers/dri/i915/i915_program.c')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_program.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index a1d32791d4..45276fb690 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -351,6 +351,9 @@ GLuint i915_emit_param4fv( struct i915_fragment_program *p, void i915_program_error( struct i915_fragment_program *p, const char *msg ) { + /* XXX we shouldn't print anything to stdout, record GL error or + * call _mesa_problem() + */ fprintf(stderr, "%s\n", msg); p->error = 1; } @@ -410,6 +413,21 @@ void i915_fini_program( struct i915_fragment_program *p ) if (p->nr_decl_insn > I915_MAX_DECL_INSN) i915_program_error(p, "Exceeded max DECL instructions"); + if (p->error) { + p->FragProg.Base.NumNativeInstructions = 0; + p->FragProg.NumNativeAluInstructions = 0; + p->FragProg.NumNativeTexInstructions = 0; + p->FragProg.NumNativeTexIndirections = 0; + } + else { + p->FragProg.Base.NumNativeInstructions = (p->nr_alu_insn + + p->nr_tex_insn + + p->nr_decl_insn); + p->FragProg.NumNativeAluInstructions = p->nr_alu_insn; + p->FragProg.NumNativeTexInstructions = p->nr_tex_insn; + p->FragProg.NumNativeTexIndirections = p->nr_tex_indirect; + } + p->declarations[0] |= program_size + decl_size - 2; } |