i915: Provide counts in the error messages for program limits.

This commit is contained in:
Eric Anholt
2010-04-26 09:04:16 -07:00
parent 20c9675994
commit 891ad6ec1a
2 changed files with 19 additions and 10 deletions

View File

@@ -359,7 +359,8 @@ upload_program(struct i915_fragment_program *p)
} }
if (program->Base.NumInstructions > I915_MAX_INSN) { if (program->Base.NumInstructions > I915_MAX_INSN) {
i915_program_error( p, "Exceeded max instructions" ); i915_program_error(p, "Exceeded max instructions (%d out of %d)",
program->Base.NumInstructions, I915_MAX_INSN);
return; return;
} }

View File

@@ -494,17 +494,25 @@ i915_fini_program(struct i915_fragment_program *p)
GLuint program_size = p->csr - p->program; GLuint program_size = p->csr - p->program;
GLuint decl_size = p->decl - p->declarations; GLuint decl_size = p->decl - p->declarations;
if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT) if (p->nr_tex_indirect > I915_MAX_TEX_INDIRECT) {
i915_program_error(p, "Exceeded max nr indirect texture lookups"); i915_program_error(p, "Exceeded max nr indirect texture lookups "
"(%d out of %d)",
p->nr_tex_indirect, I915_MAX_TEX_INDIRECT);
}
if (p->nr_tex_insn > I915_MAX_TEX_INSN) if (p->nr_tex_insn > I915_MAX_TEX_INSN) {
i915_program_error(p, "Exceeded max TEX instructions"); i915_program_error(p, "Exceeded max TEX instructions (%d out of %d)",
p->nr_tex_insn, I915_MAX_TEX_INSN);
}
if (p->nr_alu_insn > I915_MAX_ALU_INSN) if (p->nr_alu_insn > I915_MAX_ALU_INSN)
i915_program_error(p, "Exceeded max ALU instructions"); i915_program_error(p, "Exceeded max ALU instructions (%d out of %d)",
p->nr_alu_insn, I915_MAX_ALU_INSN);
if (p->nr_decl_insn > I915_MAX_DECL_INSN) if (p->nr_decl_insn > I915_MAX_DECL_INSN) {
i915_program_error(p, "Exceeded max DECL instructions"); i915_program_error(p, "Exceeded max DECL instructions (%d out of %d)",
p->nr_decl_insn, I915_MAX_DECL_INSN);
}
if (p->error) { if (p->error) {
p->FragProg.Base.NumNativeInstructions = 0; p->FragProg.Base.NumNativeInstructions = 0;