#include "main/mtypes.h"
Functions | |
void | _mesa_parse_arb_vertex_program (GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, struct gl_vertex_program *program) |
Parse the vertex program string. | |
void | _mesa_parse_arb_fragment_program (GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, struct gl_fragment_program *program) |
Notes on program parameters, etc. |
void _mesa_parse_arb_fragment_program | ( | GLcontext * | ctx, | |
GLenum | target, | |||
const GLvoid * | str, | |||
GLsizei | len, | |||
struct gl_fragment_program * | program | |||
) |
Notes on program parameters, etc.
The instructions we emit will use six kinds of source registers:
PROGRAM_INPUT - input registers PROGRAM_TEMPORARY - temp registers PROGRAM_ADDRESS - address/indirect register PROGRAM_SAMPLER - texture sampler PROGRAM_CONSTANT - indexes into program->Parameters, a known constant/literal PROGRAM_STATE_VAR - indexes into program->Parameters, and may actually be: + a state variable, like "state.fog.color", or + a pointer to a "program.local[k]" parameter, or + a pointer to a "program.env[k]" parameter
Basically, all the program.local[] and program.env[] values will get mapped into the unified gl_program->Parameters array. This solves the problem of having three separate program parameter arrays.
void _mesa_parse_arb_vertex_program | ( | GLcontext * | ctx, | |
GLenum | target, | |||
const GLvoid * | str, | |||
GLsizei | len, | |||
struct gl_vertex_program * | program | |||
) |
Parse the vertex program string.
If success, update the given vertex_program object with the new program. Else, leave the vertex_program object unchanged.