diff options
author | Brian <[email protected]> | 2006-12-14 15:01:28 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2006-12-14 15:01:28 -0700 |
commit | 0560d81ce94d27f2162d77d981468cea1b2bbd8a (patch) | |
tree | 7b59069cffbb9f48a54d2bbc82868363694a368f /src/mesa/shader/program.h | |
parent | 00cdc0a472c55330cbc58317f01b07f8f90be5a5 (diff) |
Move many functions into new files.
Diffstat (limited to 'src/mesa/shader/program.h')
-rw-r--r-- | src/mesa/shader/program.h | 203 |
1 files changed, 0 insertions, 203 deletions
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h index 98e2b536021..34485776e9e 100644 --- a/src/mesa/shader/program.h +++ b/src/mesa/shader/program.h @@ -43,37 +43,6 @@ #include "mtypes.h" -/* for GL_ARB_v_p and GL_ARB_f_p SWZ instruction */ -#define SWIZZLE_X 0 -#define SWIZZLE_Y 1 -#define SWIZZLE_Z 2 -#define SWIZZLE_W 3 -#define SWIZZLE_ZERO 4 /* keep these values together: KW */ -#define SWIZZLE_ONE 5 /* keep these values together: KW */ - -#define MAKE_SWIZZLE4(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) -#define SWIZZLE_NOOP MAKE_SWIZZLE4(0,1,2,3) -#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) -#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) - - -#define WRITEMASK_X 0x1 -#define WRITEMASK_Y 0x2 -#define WRITEMASK_XY 0x3 -#define WRITEMASK_Z 0x4 -#define WRITEMASK_XZ 0x5 -#define WRITEMASK_YZ 0x6 -#define WRITEMASK_XYZ 0x7 -#define WRITEMASK_W 0x8 -#define WRITEMASK_XW 0x9 -#define WRITEMASK_YW 0xa -#define WRITEMASK_XYW 0xb -#define WRITEMASK_ZW 0xc -#define WRITEMASK_XZW 0xd -#define WRITEMASK_YZW 0xe -#define WRITEMASK_XYZW 0xf - - extern struct gl_program _mesa_DummyProgram; @@ -125,179 +94,7 @@ extern struct gl_program * _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog); -/** - * 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 ]. - */ -typedef enum gl_state_index_ { - STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */ - - STATE_LIGHT, - STATE_LIGHTMODEL_AMBIENT, - STATE_LIGHTMODEL_SCENECOLOR, - STATE_LIGHTPROD, - - STATE_TEXGEN, - - STATE_FOG_COLOR, - STATE_FOG_PARAMS, - - STATE_CLIPPLANE, - - STATE_POINT_SIZE, - STATE_POINT_ATTENUATION, - - STATE_MATRIX, - STATE_MODELVIEW, - STATE_PROJECTION, - STATE_MVP, - STATE_TEXTURE, - STATE_PROGRAM, - STATE_MATRIX_INVERSE, - STATE_MATRIX_TRANSPOSE, - STATE_MATRIX_INVTRANS, - - STATE_AMBIENT, - STATE_DIFFUSE, - STATE_SPECULAR, - STATE_EMISSION, - STATE_SHININESS, - STATE_HALF, - - STATE_POSITION, - STATE_ATTENUATION, - STATE_SPOT_DIRECTION, - - STATE_TEXGEN_EYE_S, - STATE_TEXGEN_EYE_T, - STATE_TEXGEN_EYE_R, - STATE_TEXGEN_EYE_Q, - STATE_TEXGEN_OBJECT_S, - STATE_TEXGEN_OBJECT_T, - STATE_TEXGEN_OBJECT_R, - STATE_TEXGEN_OBJECT_Q, - - STATE_TEXENV_COLOR, - - STATE_DEPTH_RANGE, - - STATE_VERTEX_PROGRAM, - STATE_FRAGMENT_PROGRAM, - - STATE_ENV, - STATE_LOCAL, - - STATE_INTERNAL, /* Mesa additions */ - STATE_NORMAL_SCALE, - STATE_TEXRECT_SCALE, - STATE_POSITION_NORMALIZED, /* normalized light position */ - STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ -} gl_state_index; - - - -/** - * Named program parameters - * Used for NV_fragment_program "DEFINE"d constants and "DECLARE"d parameters, - * and ARB_fragment_program global state references. For the later, Name - * might be "state.light[0].diffuse", for example. - */ -struct gl_program_parameter -{ - const char *Name; /**< Null-terminated string */ - enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ - GLuint Size; /**< Number of components (1..4) */ - /** - * A sequence of STATE_* tokens and integers to identify GL state. - */ - gl_state_index StateIndexes[6]; -}; - - -/** - * A list of the above program_parameter instances. - */ -struct gl_program_parameter_list -{ - GLuint Size; /**< allocated size of Parameters, ParameterValues */ - GLuint NumParameters; /**< number of parameters in arrays */ - struct gl_program_parameter *Parameters; /**< Array [Size] */ - GLfloat (*ParameterValues)[4]; /**< Array [Size] of GLfloat[4] */ - GLbitfield StateFlags; /**< _NEW_* flags indicating which state changes - might invalidate ParameterValues[] */ -}; - - -/* - * Program parameter functions - */ - -extern struct gl_program_parameter_list * -_mesa_new_parameter_list(void); - -extern void -_mesa_free_parameter_list(struct gl_program_parameter_list *paramList); - -extern struct gl_program_parameter_list * -_mesa_clone_parameter_list(const struct gl_program_parameter_list *list); - -extern GLint -_mesa_add_parameter(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4], GLuint size, - enum register_file type); - -extern GLint -_mesa_add_named_parameter(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4]); - -extern GLint -_mesa_add_named_constant(struct gl_program_parameter_list *paramList, - const char *name, const GLfloat values[4], - GLuint size); - -extern GLint -_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList, - const GLfloat values[4], GLuint size, - GLuint *swizzleOut); - -extern GLint -_mesa_add_uniform(struct gl_program_parameter_list *paramList, - const char *name, GLuint size); - -extern GLint -_mesa_add_varying(struct gl_program_parameter_list *paramList, - const char *name, GLuint size); - -extern GLint -_mesa_add_state_reference(struct gl_program_parameter_list *paramList, - const GLint *stateTokens); - -extern GLfloat * -_mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name); - -extern GLint -_mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, - GLsizei nameLen, const char *name); - -extern GLboolean -_mesa_lookup_parameter_constant(const struct gl_program_parameter_list *paramList, - const GLfloat v[], GLsizei vSize, - GLint *posOut, GLuint *swizzleOut); - -extern void -_mesa_load_state_parameters(GLcontext *ctx, - struct gl_program_parameter_list *paramList); - -extern void -_mesa_print_instruction(const struct prog_instruction *inst); -void -_mesa_print_alu_instruction(const struct prog_instruction *inst, - const char *opcode_string, - GLuint numRegs); extern void _mesa_print_program(const struct gl_program *prog); |