diff options
author | Eric Anholt <[email protected]> | 2010-11-01 13:16:21 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-03-11 12:55:14 -0800 |
commit | 7cb87dffce2c7a37f960f3a865cf92fd193dd8c5 (patch) | |
tree | f88d21cc6c40d4397cf5e949357d096fcb8c3329 /src/mesa/main/state.c | |
parent | 29e013e58be93aa6ed760393cf77ef34ca1d57c0 (diff) |
mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen. Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization. Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
Diffstat (limited to 'src/mesa/main/state.c')
-rw-r--r-- | src/mesa/main/state.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 19c9bbabda2..1b2b2f32464 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -277,17 +277,21 @@ update_program(struct gl_context *ctx) fsProg->FragmentProgram); } else if (ctx->FragmentProgram._Enabled) { - /* use user-defined vertex program */ + /* use user-defined fragment program */ _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, ctx->FragmentProgram.Current); } else if (ctx->FragmentProgram._MaintainTexEnvProgram) { /* Use fragment program generated from fixed-function state. */ + struct gl_shader_program *f = _mesa_get_fixed_func_fragment_program(ctx); +#if 0 + _mesa_reference_shader_program(ctx, + &ctx->Shader.CurrentFragmentProgram, f); +#endif + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, - _mesa_get_fixed_func_fragment_program(ctx)); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, - ctx->FragmentProgram._Current); + f->FragmentProgram); } else { /* no fragment program */ |