#include "main/mtypes.h"
#define STATE_LENGTH 5 |
Number of STATE_* values we need to address any GL state.
Used to dimension arrays.
typedef enum gl_state_index_ gl_state_index |
enum gl_state_index_ |
Used for describing GL state referenced from inside ARB vertex and fragment programs.
A string such as "state.light[0].ambient" gets translated into a sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should always be the array index.
void _mesa_load_state_parameters | ( | GLcontext * | ctx, | |
struct gl_program_parameter_list * | paramList | |||
) |
Loop over all the parameters in a parameter list.
If the parameter is a GL state reference, look up the current value of that state variable and put it into the parameter's Value[4] array. This would be called at glBegin time when using a fragment program.
void _mesa_load_tracked_matrices | ( | GLcontext * | ctx | ) |
Load current vertex program's parameter registers with tracked matrices (if NV program).
This only needs to be done per glBegin/glEnd, not per-vertex.
GLbitfield _mesa_program_state_flags | ( | const gl_state_index | state[STATE_LENGTH] | ) |
Return a bitmask of the Mesa state flags (_NEW_* values) which would indicate that the given context state may have changed.
The bitmask is used during validation to determine if we need to update vertex/fragment program parameters (like "state.material.color") when some GL state has changed.
char* _mesa_program_state_string | ( | const gl_state_index | state[STATE_LENGTH] | ) |
Make a string from the given state vector.
For example, return "state.matrix.texture[2].inverse". Use _mesa_free() to deallocate the string.