core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

arbprogparse.c File Reference


Detailed Description

ARB_*_program parser core.

Author:
Karl Rasche

#include "main/glheader.h"
#include "main/imports.h"
#include "main/context.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "shader/grammar/grammar_mesa.h"
#include "arbprogparse.h"
#include "program.h"
#include "programopt.h"
#include "prog_parameter.h"
#include "prog_statevars.h"
#include "prog_instruction.h"
#include "program_parser.h"

Defines

#define DEBUG_PARSING   0

Functions

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_vertex_program (GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, struct gl_vertex_program *program)
 Parse the vertex program string.


Define Documentation

#define DEBUG_PARSING   0


Function Documentation

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.


Generated on Sun Sep 27 06:48:01 2009 for Mesa Vertex and Fragment Program code by  doxygen 1.5.4