Defines | |
#define | PROGRAMOPT_H 1 |
Functions | |
void | _mesa_insert_mvp_code (GLcontext *ctx, struct gl_vertex_program *vprog) |
void | _mesa_append_fog_code (GLcontext *ctx, struct gl_fragment_program *fprog) |
Append extra instructions onto the given fragment program to implement the fog mode specified by fprog->FogOption. | |
void | _mesa_count_texture_indirections (struct gl_program *prog) |
Count the number of texure indirections in the given program. | |
void | _mesa_count_texture_instructions (struct gl_program *prog) |
Count number of texture instructions in given program and update the program's NumTexInstructions field. | |
void | _mesa_remove_output_reads (struct gl_program *prog, gl_register_file type) |
Scan/rewrite program to remove reads of custom (output) registers. |
#define PROGRAMOPT_H 1 |
void _mesa_append_fog_code | ( | GLcontext * | ctx, | |
struct gl_fragment_program * | fprog | |||
) |
Append extra instructions onto the given fragment program to implement the fog mode specified by fprog->FogOption.
The fragment.fogcoord input is used to compute the fog blend factor.
XXX with a little work, this function could be adapted to add fog code to vertex programs too.
void _mesa_count_texture_indirections | ( | struct gl_program * | prog | ) |
Count the number of texure indirections in the given program.
The program's NumTexIndirections field will be updated. See the GL_ARB_fragment_program spec (issue 24) for details. XXX we count texture indirections in texenvprogram.c (maybe use this code instead and elsewhere).
void _mesa_count_texture_instructions | ( | struct gl_program * | prog | ) |
Count number of texture instructions in given program and update the program's NumTexInstructions field.
void _mesa_insert_mvp_code | ( | GLcontext * | ctx, | |
struct gl_vertex_program * | vprog | |||
) |
void _mesa_remove_output_reads | ( | struct gl_program * | prog, | |
gl_register_file | type | |||
) |
Scan/rewrite program to remove reads of custom (output) registers.
The passed type has to be either PROGRAM_OUTPUT or PROGRAM_VARYING (for vertex shaders). In GLSL shaders, varying vars can be read and written. On some hardware, trying to read an output register causes trouble. So, rewrite the program to use a temporary register in this case.