diff options
author | Eric Anholt <[email protected]> | 2010-11-01 13:16:21 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-10-18 10:54:32 -0700 |
commit | 7ec2b0d0d6b6a0f760e55ffdee0bdb385a3e900a (patch) | |
tree | 8e1bb41c346e163be51973f04b8c244352dd051c /src/mesa/main/state.c | |
parent | 57f7978b1de40be6eb138d391c8d9f95b68cbf62 (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 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index bbe90a32e08..98ca733c0b9 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -260,10 +260,11 @@ update_program(struct gl_context *ctx) } 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); + _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, - _mesa_get_fixed_func_fragment_program(ctx)); - _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, - ctx->FragmentProgram._Current); + (struct gl_fragment_program *) + f->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program); } else { /* No fragment program */ |