i915: Update and translate the fragment program along with state updates.

Previously, we were doing it in the midst of the pipeline run, which gave
an opportunity to enable/disable fallbacks, which is certainly the wrong
time to be doing so.  This manifested itself in a NULL dereference for PutRow
after transitioning out of a fallback during a run_pipeline in glean glsl1.
This commit is contained in:
Eric Anholt
2009-07-29 23:37:04 -07:00
parent d6fbf87575
commit 61b512c47c
4 changed files with 26 additions and 14 deletions

View File

@@ -1058,6 +1058,28 @@ i915ProgramStringNotify(GLcontext * ctx,
_tnl_program_string(ctx, target, prog);
}
void
i915_update_program(GLcontext *ctx)
{
struct intel_context *intel = intel_context(ctx);
struct i915_context *i915 = i915_context(&intel->ctx);
struct i915_fragment_program *fp =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
if (i915->current_program != fp) {
if (i915->current_program) {
i915->current_program->on_hardware = 0;
i915->current_program->params_uptodate = 0;
}
i915->current_program = fp;
}
if (!fp->translated)
translate_program(fp);
FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, fp->error);
}
void
i915ValidateFragmentProgram(struct i915_context *i915)
@@ -1075,16 +1097,6 @@ i915ValidateFragmentProgram(struct i915_context *i915)
GLuint s2 = S2_TEXCOORD_NONE;
int i, offset = 0;
if (i915->current_program != p) {
if (i915->current_program) {
i915->current_program->on_hardware = 0;
i915->current_program->params_uptodate = 0;
}
i915->current_program = p;
}
/* Important:
*/
VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr;