Lines Matching refs:state

27  * Program state variable management.
75 * Use the list of tokens in the state[] array to find global GL state
79 * The program parser will produce the state[] values.
82 fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
87 switch (state[0]) {
90 /* state[1] is MAT_ATTRIB_FRONT_* */
91 const GLuint index = (GLuint) state[1];
107 /* state[1] is the light number */
108 const GLuint ln = (GLuint) state[1];
109 /* state[2] is the light attribute */
110 const unsigned index = state[2] - STATE_AMBIENT;
124 /* state[1] is the index of the first value */
125 /* state[2] is the number of values */
126 assert(state[1] + state[2] <= ARRAY_SIZE(ctx->Light.LightSourceData));
127 memcpy(value, &ctx->Light.LightSourceData[state[1]],
128 state[2] * sizeof(float));
132 const unsigned first = state[1];
133 const unsigned num_lights = state[2];
145 if (state[1] == 0) {
168 const GLuint ln = (GLuint) state[1];
169 const GLuint index = (GLuint) state[2];
191 const unsigned first_light = state[1];
192 const unsigned num_lights = state[2];
217 const unsigned first_light = state[1];
218 const unsigned num_lights = state[2];
243 const unsigned first_light = state[1];
244 const unsigned num_lights = state[2];
270 /* state[1] is the texture unit */
271 const GLuint unit = (GLuint) state[1];
272 /* state[2] is the texgen attribute */
291 (state[2] - STATE_TEXGEN_EYE_S) * 4;
297 /* state[1] is the texture unit */
298 const GLuint unit = (GLuint) state[1];
319 const GLuint plane = (GLuint) state[1];
335 /* state[0] = modelview, projection, texture, etc. */
336 /* state[1] = which texture matrix or program matrix */
337 /* state[2] = first row to fetch */
338 /* state[3] = last row to fetch */
341 copy_matrix(value, matrix->m, state[2], state[3]);
346 copy_matrix(value, matrix->inv, state[2], state[3]);
351 copy_matrix_transposed(value, matrix->m, state[2], state[3]);
356 copy_matrix_transposed(value, matrix->inv, state[2], state[3]);
361 copy_matrix(value, matrix->m, state[2], state[3]);
367 copy_matrix(value, matrix->inv, state[2], state[3]);
372 copy_matrix_transposed(value, matrix->m, state[2], state[3]);
378 copy_matrix_transposed(value, matrix->inv, state[2], state[3]);
383 copy_matrix(value, matrix->m, state[2], state[3]);
389 copy_matrix(value, matrix->inv, state[2], state[3]);
394 copy_matrix_transposed(value, matrix->m, state[2], state[3]);
400 copy_matrix_transposed(value, matrix->inv, state[2], state[3]);
404 const GLuint index = (GLuint) state[1];
407 copy_matrix(value, matrix->m, state[2], state[3]);
411 const GLuint index = (GLuint) state[1];
414 copy_matrix(value, matrix->inv, state[2], state[3]);
418 const GLuint index = (GLuint) state[1];
421 copy_matrix_transposed(value, matrix->m, state[2], state[3]);
425 const GLuint index = (GLuint) state[1];
428 copy_matrix_transposed(value, matrix->inv, state[2], state[3]);
432 const GLuint index = (GLuint) state[1];
435 copy_matrix(value, matrix->m, state[2], state[3]);
439 const GLuint index = (GLuint) state[1];
443 copy_matrix(value, matrix->inv, state[2], state[3]);
447 const GLuint index = (GLuint) state[1];
450 copy_matrix_transposed(value, matrix->m, state[2], state[3]);
454 const GLuint index = (GLuint) state[1];
458 copy_matrix_transposed(value, matrix->inv, state[2], state[3]);
471 const int idx = (int) state[1];
476 const unsigned idx = state[1];
477 const unsigned bytes = state[2] * 16;
492 const int idx = (int) state[1];
497 const unsigned idx = state[1];
498 const unsigned bytes = state[2] * 16;
512 const int idx = (int) state[1];
517 const unsigned idx = state[1];
518 const unsigned bytes = state[2] * 16;
533 const int idx = (int) state[1];
538 const unsigned idx = state[1];
539 const unsigned bytes = state[2] * 16;
559 const GLuint idx = (GLuint) state[1];
566 const GLuint idx = (GLuint) state[1];
640 /* here, state[1] is the light number */
642 const GLuint ln = (GLuint) state[1];
650 const GLuint ln = (GLuint) state[1];
656 const unsigned first = state[1];
657 const unsigned num_lights = state[2];
667 const GLuint ln = (GLuint) state[1];
676 const unsigned first = state[1];
677 const unsigned num_lights = state[2];
690 const GLuint ln = (GLuint) state[1];
728 * instead of XY (based on e.g. some other state). */
779 const GLuint plane = (GLuint) state[1];
786 const GLuint counter = (GLuint) state[1];
794 _mesa_program_state_value_size(const gl_state_index16 state[STATE_LENGTH])
796 if (state[0] == STATE_LIGHT && state[2] == STATE_SPOT_CUTOFF)
804 * Return a bitmask of the Mesa state flags (_NEW_* values) which would
805 * indicate that the given context state may have changed.
807 * vertex/fragment program parameters (like "state.material.color") when
808 * some GL state has changed.
811 _mesa_program_state_flags(const gl_state_index16 state[STATE_LENGTH])
813 switch (state[0]) {
930 return 0; /* internal driver state */
936 _mesa_problem(NULL, "unexpected state[0] in make_state_flags()");
1211 /* probably STATE_INTERNAL_DRIVER+i (driver private state) */
1225 * Make a string from the given state vector.
1226 * For example, return "state.matrix.texture[2].inverse".
1230 _mesa_program_state_string(const gl_state_index16 state[STATE_LENGTH])
1235 append(str, "state.");
1236 append_token(str, state[0]);
1238 switch (state[0]) {
1240 append_index(str, state[1], true); /* light number [i]. */
1241 append_token(str, state[2]); /* coefficients */
1246 if (state[1] == 0) {
1254 append_index(str, state[1], false); /* light number [i] */
1255 append_index(str, state[2], false);
1258 append_index(str, state[1], true); /* tex unit [i] */
1259 append_token(str, state[2]); /* plane coef */
1262 append_index(str, state[1], true); /* tex unit [i] */
1266 append_index(str, state[1], true); /* plane [i] */
1290 /* state[0] = modelview, projection, texture, etc. */
1291 /* state[1] = which texture matrix or program matrix */
1292 /* state[2] = first row to fetch */
1293 /* state[3] = last row to fetch */
1294 const gl_state_index mat = state[0];
1295 const GLuint index = (GLuint) state[1];
1296 const GLuint firstRow = (GLuint) state[2];
1297 const GLuint lastRow = (GLuint) state[3];
1320 sprintf(tmp, "[%d..%d]", state[1], state[1] + state[2] - 1);
1336 append_index(str, state[1], false);
1362 _mesa_problem(NULL, "Invalid state in _mesa_program_state_string: %d", state[0]);
1372 * is a GL state reference, look up the current value of that state
1408 /* Merge consecutive state vars into one for the state vars that allow
1412 * have to deal with multi-slot state parameters in their backends.
1445 /* Skip unaligned state vars. */
1449 /* Search for adjacent state vars that refer to adjacent rows. */
1461 break; /* The adjacent state var is incompatible. */
1479 /* Skip trimmed state vars. (this shouldn't occur though) */
1503 break; /* The adjacent state var is incompatible. */
1506 /* Convert the state var to STATE_LIGHT_ARRAY. */
1546 break; /* The adjacent state var is incompatible. */
1551 /* Convert the state var to STATE_LIGHT_ATTENUATION_ARRAY. */
1571 /* Search for adjacent mergeable state vars. */
1581 break; /* The adjacent state var is incompatible. */
1608 gl_state_index16 state = STATE_NOT_STATE_VAR;
1632 (state == STATE_NOT_STATE_VAR || state == state_iter)) {
1654 state = state_iter;
1666 list->Parameters[first_param].StateIndexes[0] = state;
1687 break; /* The adjacent state var is incompatible. */
1692 /* Convert the state var to STATE_LIGHT_POSITION_*ARRAY. */
1716 /* Remove the merged state vars. */