__DRIcontextPrivate * driContextPriv,
void *sharedContextPrivate);
-extern void r300SelectVertexShader(r300ContextPtr r300);
extern void r300InitShaderFuncs(struct dd_function_table *functions);
extern void r300InitShaderFunctions(r300ContextPtr r300);
r300TranslateFragmentShader(ctx, fp);
return !fp->error;
- } else
- return GL_TRUE;
+ } else {
+ struct r300_vertex_program *vp = r300SelectVertexShader(ctx);
+ if (!vp->translated)
+ r300TranslateVertexShader(vp);
+
+ return !vp->error;
+ }
}
void r300InitShaderFuncs(struct dd_function_table *functions)
}
if (rmesa->radeon.NewGLState && rmesa->options.hw_tcl_enabled) {
+ struct r300_vertex_program *vp;
int i;
for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
rmesa->temp_attrib[i] =
rmesa->temp_attrib[i];
}
- r300SelectVertexShader(rmesa);
- r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, rmesa->selected_vp->error);
+ vp = r300SelectVertexShader(ctx);
+ if (!vp->translated)
+ r300TranslateVertexShader(vp);
+
+ r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error);
}
fp = r300SelectFragmentShader(ctx);
}
}
-static void r300TranslateVertexShader(struct r300_vertex_program *vp)
+void r300TranslateVertexShader(struct r300_vertex_program *vp)
{
struct prog_instruction *vpi = vp->Base->Base.Instructions;
int i;
assert(prog->NumInstructions);
vp->num_temporaries = prog->NumTemporaries;
- r300TranslateVertexShader(vp);
return vp;
}
key->OutputsAdded |= 1 << vert;
}
-void r300SelectVertexShader(r300ContextPtr r300)
+struct r300_vertex_program * r300SelectVertexShader(GLcontext *ctx)
{
- GLcontext *ctx = ctx = r300->radeon.glCtx;
+ r300ContextPtr r300 = R300_CONTEXT(ctx);
GLuint InputsRead;
struct r300_vertex_program_key wanted_key = { 0 };
GLint i;
for (vp = vpc->progs; vp; vp = vp->next)
if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key))
== 0) {
- r300->selected_vp = vp;
- return;
+ return r300->selected_vp = vp;
}
vp = build_program(ctx, &wanted_key, &vpc->mesa_program, wpos_idx);
vp->next = vpc->progs;
vpc->progs = vp;
- r300->selected_vp = vp;
+
+ return r300->selected_vp = vp;
}
#define bump_vpu_count(ptr, new_count) do { \