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.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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 */
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
struct gl_context;
|
||||
|
||||
extern struct gl_fragment_program *
|
||||
extern struct gl_shader_program *
|
||||
_mesa_get_fixed_func_fragment_program(struct gl_context *ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -140,7 +140,7 @@ _mesa_free_program_data(struct gl_context *ctx)
|
||||
#endif
|
||||
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
|
||||
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
|
||||
_mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache);
|
||||
_mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
|
||||
#endif
|
||||
#if FEATURE_ARB_geometry_shader4
|
||||
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
|
||||
|
Reference in New Issue
Block a user