From 7ec2b0d0d6b6a0f760e55ffdee0bdb385a3e900a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 1 Nov 2010 13:16:21 -0700 Subject: 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. --- src/mesa/main/state.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/state.c') 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 */ -- cgit v1.2.3