2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef PROG_STATEVARS_H
26 #define PROG_STATEVARS_H
29 #include "main/glheader.h"
30 #include "compiler/shader_enums.h"
39 struct gl_program_parameter_list
;
43 * Used for describing GL state referenced from inside ARB vertex and
45 * A string such as "state.light[0].ambient" gets translated into a
46 * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ].
48 * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
49 * always be the array index.
51 typedef enum gl_state_index_
{
52 STATE_MATERIAL
= 100, /* start at 100 so small ints are seen as ints */
55 STATE_LIGHTMODEL_AMBIENT
,
56 STATE_LIGHTMODEL_SCENECOLOR
,
67 STATE_POINT_ATTENUATION
,
69 STATE_MODELVIEW_MATRIX
,
70 STATE_PROJECTION_MATRIX
,
75 STATE_MATRIX_TRANSPOSE
,
76 STATE_MATRIX_INVTRANS
,
85 STATE_POSITION
, /**< xyzw = position */
86 STATE_ATTENUATION
, /**< xyz = attenuation, w = spot exponent */
87 STATE_SPOT_DIRECTION
, /**< xyz = direction, w = cos(cutoff) */
88 STATE_SPOT_CUTOFF
, /**< x = cutoff, yzw = undefined */
94 STATE_TEXGEN_OBJECT_S
,
95 STATE_TEXGEN_OBJECT_T
,
96 STATE_TEXGEN_OBJECT_R
,
97 STATE_TEXGEN_OBJECT_Q
,
101 STATE_NUM_SAMPLES
, /* An integer, not a float like the other state vars */
105 STATE_VERTEX_PROGRAM
,
106 STATE_FRAGMENT_PROGRAM
,
111 STATE_INTERNAL
, /* Mesa additions */
112 STATE_CURRENT_ATTRIB
, /* ctx->Current vertex attrib value */
113 STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED
, /* ctx->Current vertex attrib value after passthrough vertex processing */
115 STATE_FOG_PARAMS_OPTIMIZED
, /* for faster fog calc */
116 STATE_POINT_SIZE_CLAMPED
, /* includes implementation dependent size clamp */
117 STATE_LIGHT_SPOT_DIR_NORMALIZED
, /* pre-normalized spot dir */
118 STATE_LIGHT_POSITION
, /* object vs eye space */
119 STATE_LIGHT_POSITION_NORMALIZED
, /* object vs eye space */
120 STATE_LIGHT_HALF_VECTOR
, /* object vs eye space */
121 STATE_PT_SCALE
, /**< Pixel transfer RGBA scale */
122 STATE_PT_BIAS
, /**< Pixel transfer RGBA bias */
123 STATE_FB_SIZE
, /**< (width-1, height-1, 0, 0) */
124 STATE_FB_WPOS_Y_TRANSFORM
, /**< (1, 0, -1, height) if a FBO is bound, (-1, height, 1, 0) otherwise */
125 STATE_TCS_PATCH_VERTICES_IN
, /**< gl_PatchVerticesIn for TCS (integer) */
126 STATE_TES_PATCH_VERTICES_IN
, /**< gl_PatchVerticesIn for TES (integer) */
128 * A single enum gl_blend_support_qualifier value representing the
129 * currently active advanced blending equation, or zero if disabled.
131 STATE_ADVANCED_BLENDING_MODE
,
132 STATE_ALPHA_REF
, /* alpha-test reference value */
133 STATE_CLIP_INTERNAL
, /* similar to STATE_CLIPPLANE, but in clip-space */
134 STATE_INTERNAL_DRIVER
/* first available state index for drivers (must be last) */
139 _mesa_load_state_parameters(struct gl_context
*ctx
,
140 struct gl_program_parameter_list
*paramList
);
143 _mesa_program_state_value_size(const gl_state_index16 state
[STATE_LENGTH
]);
146 _mesa_program_state_flags(const gl_state_index16 state
[STATE_LENGTH
]);
150 _mesa_program_state_string(const gl_state_index16 state
[STATE_LENGTH
]);
158 #endif /* PROG_STATEVARS_H */