Bug #13492: Only call ProgramStringNotify if program parsing succeeded.
[mesa.git] / src / mesa / shader / prog_statevars.h
index 17e38054bb3ba96a18ce9199dc0fc86c604a1a49..22bb8e07ad106dd4b79115a4185da8fa08e78068 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  7.1
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #include "mtypes.h"
 
 
+/**
+ * Number of STATE_* values we need to address any GL state.
+ * Used to dimension arrays.
+ */
+#define STATE_LENGTH 5
+
+
 /**
  * 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 ].
+ *
+ * For state that's an array, like STATE_CLIPPLANE, the 2nd token [1] should
+ * always be the array index.
  */
 typedef enum gl_state_index_ {
    STATE_MATERIAL = 100,  /* start at 100 so small ints are seen as ints */
@@ -52,12 +62,11 @@ typedef enum gl_state_index_ {
    STATE_POINT_SIZE,
    STATE_POINT_ATTENUATION,
 
-   STATE_MATRIX,
-   STATE_MODELVIEW,
-   STATE_PROJECTION,
-   STATE_MVP,
-   STATE_TEXTURE,
-   STATE_PROGRAM,
+   STATE_MODELVIEW_MATRIX,
+   STATE_PROJECTION_MATRIX,
+   STATE_MVP_MATRIX,
+   STATE_TEXTURE_MATRIX,
+   STATE_PROGRAM_MATRIX,
    STATE_MATRIX_INVERSE,
    STATE_MATRIX_TRANSPOSE,
    STATE_MATRIX_INVTRANS,
@@ -67,11 +76,12 @@ typedef enum gl_state_index_ {
    STATE_SPECULAR,
    STATE_EMISSION,
    STATE_SHININESS,
-   STATE_HALF, 
+   STATE_HALF_VECTOR,  
 
    STATE_POSITION,
    STATE_ATTENUATION,
    STATE_SPOT_DIRECTION,
+   STATE_SPOT_CUTOFF,
 
    STATE_TEXGEN_EYE_S,
    STATE_TEXGEN_EYE_T,
@@ -96,6 +106,8 @@ typedef enum gl_state_index_ {
    STATE_NORMAL_SCALE,
    STATE_TEXRECT_SCALE,
    STATE_POSITION_NORMALIZED,   /* normalized light position */
+   STATE_FOG_PARAMS_OPTIMIZED,  /* for faster fog calc */
+   STATE_SPOT_DIR_NORMALIZED,   /* pre-normalized spot dir */
    STATE_INTERNAL_DRIVER       /* first available state index for drivers (must be last) */
 } gl_state_index;
 
@@ -107,11 +119,15 @@ _mesa_load_state_parameters(GLcontext *ctx,
 
 
 extern GLbitfield
-_mesa_program_state_flags(const GLint state[]);
+_mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]);
 
 
 extern const char *
-_mesa_program_state_string(const GLint state[6]);
+_mesa_program_state_string(const gl_state_index state[STATE_LENGTH]);
+
+
+extern void
+_mesa_load_tracked_matrices(GLcontext *ctx);
 
 
 #endif /* PROG_STATEVARS_H */