diff options
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_context.c | 17 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/i915_program.c | 18 |
2 files changed, 26 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 6e6af35c76..cd0eaf2470 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -154,16 +154,15 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis, * we'll still have to check and fallback each time. */ - ctx->Const.MaxFragmentProgramTemps = I915_MAX_TEMPORARY; - ctx->Const.MaxFragmentProgramAttribs = 11; /* 8 tex, 2 color, fog */ - ctx->Const.MaxFragmentProgramLocalParams = I915_MAX_CONSTANT; - ctx->Const.MaxFragmentProgramEnvParams = I915_MAX_CONSTANT; - ctx->Const.MaxFragmentProgramAluInstructions = I915_MAX_ALU_INSN; - ctx->Const.MaxFragmentProgramTexInstructions = I915_MAX_TEX_INSN; - ctx->Const.MaxFragmentProgramInstructions = (I915_MAX_ALU_INSN + + ctx->Const.FragmentProgram.MaxNativeTemps = I915_MAX_TEMPORARY; + ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* 8 tex, 2 color, fog */ + ctx->Const.FragmentProgram.MaxNativeParameters = I915_MAX_CONSTANT; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = I915_MAX_ALU_INSN; + ctx->Const.FragmentProgram.MaxNativeTexInstructions = I915_MAX_TEX_INSN; + ctx->Const.FragmentProgram.MaxNativeInstructions = (I915_MAX_ALU_INSN + I915_MAX_TEX_INSN); - ctx->Const.MaxFragmentProgramTexIndirections = I915_MAX_TEX_INDIRECT; - ctx->Const.MaxFragmentProgramAddressRegs = 0; /* I don't think we have one */ + ctx->Const.FragmentProgram.MaxNativeTexIndirections = I915_MAX_TEX_INDIRECT; + ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* I don't think we have one */ driInitExtensions( ctx, i915_extensions, GL_FALSE ); 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; } |