| Brian | 00cdc0a | 2006-12-14 15:01:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Mesa 3-D graphics library |
| 3 | * Version: 6.5.2 |
| 4 | * |
| 5 | * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. |
| 6 | * |
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | * copy of this software and associated documentation files (the "Software"), |
| 9 | * to deal in the Software without restriction, including without limitation |
| 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | * and/or sell copies of the Software, and to permit persons to whom the |
| 12 | * Software is furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included |
| 15 | * in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #ifndef PROG_STATEVARS_H |
| 26 | #define PROG_STATEVARS_H |
| 27 | |
| 28 | #include "mtypes.h" |
| 29 | |
| 30 | |
| 31 | /** |
| Brian | b7978af | 2007-01-09 19:17:17 -0700 | [diff] [blame^] | 32 | * Number of STATE_* values we need to address any GL state. |
| 33 | * Used to dimension arrays. |
| 34 | */ |
| 35 | #define STATE_LENGTH 6 |
| 36 | |
| 37 | |
| 38 | /** |
| Brian | 00cdc0a | 2006-12-14 15:01:06 -0700 | [diff] [blame] | 39 | * Used for describing GL state referenced from inside ARB vertex and |
| 40 | * fragment programs. |
| 41 | * A string such as "state.light[0].ambient" gets translated into a |
| 42 | * sequence of tokens such as [ STATE_LIGHT, 0, STATE_AMBIENT ]. |
| 43 | */ |
| 44 | typedef enum gl_state_index_ { |
| 45 | STATE_MATERIAL = 100, /* start at 100 so small ints are seen as ints */ |
| 46 | |
| 47 | STATE_LIGHT, |
| 48 | STATE_LIGHTMODEL_AMBIENT, |
| 49 | STATE_LIGHTMODEL_SCENECOLOR, |
| 50 | STATE_LIGHTPROD, |
| 51 | |
| 52 | STATE_TEXGEN, |
| 53 | |
| 54 | STATE_FOG_COLOR, |
| 55 | STATE_FOG_PARAMS, |
| 56 | |
| 57 | STATE_CLIPPLANE, |
| 58 | |
| 59 | STATE_POINT_SIZE, |
| 60 | STATE_POINT_ATTENUATION, |
| 61 | |
| 62 | STATE_MATRIX, |
| 63 | STATE_MODELVIEW, |
| 64 | STATE_PROJECTION, |
| 65 | STATE_MVP, |
| 66 | STATE_TEXTURE, |
| 67 | STATE_PROGRAM, |
| 68 | STATE_MATRIX_INVERSE, |
| 69 | STATE_MATRIX_TRANSPOSE, |
| 70 | STATE_MATRIX_INVTRANS, |
| 71 | |
| 72 | STATE_AMBIENT, |
| 73 | STATE_DIFFUSE, |
| 74 | STATE_SPECULAR, |
| 75 | STATE_EMISSION, |
| 76 | STATE_SHININESS, |
| 77 | STATE_HALF, |
| 78 | |
| 79 | STATE_POSITION, |
| 80 | STATE_ATTENUATION, |
| 81 | STATE_SPOT_DIRECTION, |
| 82 | |
| 83 | STATE_TEXGEN_EYE_S, |
| 84 | STATE_TEXGEN_EYE_T, |
| 85 | STATE_TEXGEN_EYE_R, |
| 86 | STATE_TEXGEN_EYE_Q, |
| 87 | STATE_TEXGEN_OBJECT_S, |
| 88 | STATE_TEXGEN_OBJECT_T, |
| 89 | STATE_TEXGEN_OBJECT_R, |
| 90 | STATE_TEXGEN_OBJECT_Q, |
| 91 | |
| 92 | STATE_TEXENV_COLOR, |
| 93 | |
| 94 | STATE_DEPTH_RANGE, |
| 95 | |
| 96 | STATE_VERTEX_PROGRAM, |
| 97 | STATE_FRAGMENT_PROGRAM, |
| 98 | |
| 99 | STATE_ENV, |
| 100 | STATE_LOCAL, |
| 101 | |
| 102 | STATE_INTERNAL, /* Mesa additions */ |
| 103 | STATE_NORMAL_SCALE, |
| 104 | STATE_TEXRECT_SCALE, |
| 105 | STATE_POSITION_NORMALIZED, /* normalized light position */ |
| Brian | 3209c3e | 2007-01-09 17:49:24 -0700 | [diff] [blame] | 106 | STATE_USER_ATTRIB, /** shader vertex attrib: user-specified */ |
| 107 | STATE_AUTO_ATTRIB, /** shader vertex attrib: linker-specified */ |
| Brian | 00cdc0a | 2006-12-14 15:01:06 -0700 | [diff] [blame] | 108 | STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ |
| 109 | } gl_state_index; |
| 110 | |
| 111 | |
| 112 | |
| 113 | extern void |
| 114 | _mesa_load_state_parameters(GLcontext *ctx, |
| 115 | struct gl_program_parameter_list *paramList); |
| 116 | |
| 117 | |
| 118 | extern GLbitfield |
| Brian | b7978af | 2007-01-09 19:17:17 -0700 | [diff] [blame^] | 119 | _mesa_program_state_flags(const GLint state[STATE_LENGTH]); |
| Brian | 00cdc0a | 2006-12-14 15:01:06 -0700 | [diff] [blame] | 120 | |
| 121 | |
| 122 | extern const char * |
| Brian | b7978af | 2007-01-09 19:17:17 -0700 | [diff] [blame^] | 123 | _mesa_program_state_string(const GLint state[STATE_LENGTH]); |
| Brian | 00cdc0a | 2006-12-14 15:01:06 -0700 | [diff] [blame] | 124 | |
| 125 | |
| 126 | #endif /* PROG_STATEVARS_H */ |