mesa: implement glGet queries and error handling for ARB_transform_feedback3
[mesa.git] / src / mesa / main / mtypes.h
index f18b81ecb6001baa4210ae34a042139bb2df8dfc..578ac9485d7ff000efaab1ffd4e4b1f83e8940f6 100644 (file)
@@ -629,6 +629,26 @@ struct gl_config
 /*@}*/
 
 
+/**
+ * Material state.
+ */
+struct gl_material
+{
+   GLfloat Attrib[MAT_ATTRIB_MAX][4];
+};
+
+
+/**
+ * Light state flags.
+ */
+/*@{*/
+#define LIGHT_SPOT         0x1
+#define LIGHT_LOCAL_VIEWER 0x2
+#define LIGHT_POSITIONAL   0x4
+#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
+/*@}*/
+
+
 /**
  * Light source state.
  */
@@ -654,7 +674,7 @@ struct gl_light
     * \name Derived fields
     */
    /*@{*/
-   GLbitfield _Flags;          /**< State */
+   GLbitfield _Flags;          /**< Mask of LIGHT_x bits defined above */
 
    GLfloat _Position[4];       /**< position in eye/obj coordinates */
    GLfloat _VP_inf_norm[3];    /**< Norm direction to infinite light */
@@ -682,15 +702,6 @@ struct gl_lightmodel
 };
 
 
-/**
- * Material state.
- */
-struct gl_material
-{
-   GLfloat Attrib[MAT_ATTRIB_MAX][4];
-};
-
-
 /**
  * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
  */
@@ -912,16 +923,6 @@ struct gl_hint_attrib
    GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */
 };
 
-/**
- * Light state flags.
- */
-/*@{*/
-#define LIGHT_SPOT         0x1
-#define LIGHT_LOCAL_VIEWER 0x2
-#define LIGHT_POSITIONAL   0x4
-#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
-/*@}*/
-
 
 /**
  * Lighting attribute group (GL_LIGHT_BIT).
@@ -932,20 +933,19 @@ struct gl_light_attrib
    struct gl_lightmodel Model;         /**< Lighting model */
 
    /**
-    * Must flush FLUSH_VERTICES before referencing:
+    * Front and back material values.
+    * Note: must call FLUSH_VERTICES() before using.
     */
-   /*@{*/
-   struct gl_material Material;        /**< Includes front & back values */
-   /*@}*/
+   struct gl_material Material;
 
    GLboolean Enabled;                  /**< Lighting enabled flag */
    GLenum ShadeModel;                  /**< GL_FLAT or GL_SMOOTH */
    GLenum ProvokingVertex;              /**< GL_EXT_provoking_vertex */
    GLenum ColorMaterialFace;           /**< GL_FRONT, BACK or FRONT_AND_BACK */
    GLenum ColorMaterialMode;           /**< GL_AMBIENT, GL_DIFFUSE, etc */
-   GLbitfield ColorMaterialBitmask;    /**< bitmask formed from Face and Mode */
+   GLbitfield _ColorMaterialBitmask;   /**< bitmask formed from Face and Mode */
    GLboolean ColorMaterialEnabled;
-   GLenum ClampVertexColor;
+   GLenum ClampVertexColor;             /**< GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
    GLboolean _ClampVertexColor;
 
    struct gl_light EnabledList;         /**< List sentinel */
@@ -1180,46 +1180,6 @@ typedef enum
 /*@}*/
 
 
-/**
- * TexGenEnabled flags.
- */
-/*@{*/
-#define S_BIT 1
-#define T_BIT 2
-#define R_BIT 4
-#define Q_BIT 8
-#define STR_BITS (S_BIT | T_BIT | R_BIT)
-/*@}*/
-
-
-/**
- * Bit flag versions of the corresponding GL_ constants.
- */
-/*@{*/
-#define TEXGEN_SPHERE_MAP        0x1
-#define TEXGEN_OBJ_LINEAR        0x2
-#define TEXGEN_EYE_LINEAR        0x4
-#define TEXGEN_REFLECTION_MAP_NV 0x8
-#define TEXGEN_NORMAL_MAP_NV     0x10
-
-#define TEXGEN_NEED_NORMALS      (TEXGEN_SPHERE_MAP        | \
-                                 TEXGEN_REFLECTION_MAP_NV | \
-                                 TEXGEN_NORMAL_MAP_NV)
-#define TEXGEN_NEED_EYE_COORD    (TEXGEN_SPHERE_MAP        | \
-                                 TEXGEN_REFLECTION_MAP_NV | \
-                                 TEXGEN_NORMAL_MAP_NV     | \
-                                 TEXGEN_EYE_LINEAR)
-/*@}*/
-
-
-
-/** Tex-gen enabled for texture unit? */
-#define ENABLE_TEXGEN(unit) (1 << (unit))
-
-/** Non-identity texture matrix for texture unit? */
-#define ENABLE_TEXMAT(unit) (1 << (unit))
-
-
 /**
  * Texture image state.  Drivers will typically create a subclass of this
  * with extra fields for memory buffers, etc.
@@ -1366,6 +1326,46 @@ struct gl_tex_env_combine_state
 };
 
 
+/**
+ * TexGenEnabled flags.
+ */
+/*@{*/
+#define S_BIT 1
+#define T_BIT 2
+#define R_BIT 4
+#define Q_BIT 8
+#define STR_BITS (S_BIT | T_BIT | R_BIT)
+/*@}*/
+
+
+/**
+ * Bit flag versions of the corresponding GL_ constants.
+ */
+/*@{*/
+#define TEXGEN_SPHERE_MAP        0x1
+#define TEXGEN_OBJ_LINEAR        0x2
+#define TEXGEN_EYE_LINEAR        0x4
+#define TEXGEN_REFLECTION_MAP_NV 0x8
+#define TEXGEN_NORMAL_MAP_NV     0x10
+
+#define TEXGEN_NEED_NORMALS      (TEXGEN_SPHERE_MAP        | \
+                                 TEXGEN_REFLECTION_MAP_NV | \
+                                 TEXGEN_NORMAL_MAP_NV)
+#define TEXGEN_NEED_EYE_COORD    (TEXGEN_SPHERE_MAP        | \
+                                 TEXGEN_REFLECTION_MAP_NV | \
+                                 TEXGEN_NORMAL_MAP_NV     | \
+                                 TEXGEN_EYE_LINEAR)
+/*@}*/
+
+
+
+/** Tex-gen enabled for texture unit? */
+#define ENABLE_TEXGEN(unit) (1 << (unit))
+
+/** Non-identity texture matrix for texture unit? */
+#define ENABLE_TEXMAT(unit) (1 << (unit))
+
+
 /**
  * Texture coord generation state.
  */
@@ -1795,7 +1795,7 @@ struct gl_transform_feedback_info
     * hardware back-ends to determine the correct stride when interleaving
     * multiple transform feedback outputs in the same buffer.
     */
-   unsigned BufferStride[MAX_FEEDBACK_ATTRIBS];
+   unsigned BufferStride[MAX_FEEDBACK_BUFFERS];
 };
 
 
@@ -1812,13 +1812,13 @@ struct gl_transform_feedback_object
                                 at least once? */
 
    /** The feedback buffers */
-   GLuint BufferNames[MAX_FEEDBACK_ATTRIBS];
-   struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS];
+   GLuint BufferNames[MAX_FEEDBACK_BUFFERS];
+   struct gl_buffer_object *Buffers[MAX_FEEDBACK_BUFFERS];
 
    /** Start of feedback data in dest buffer */
-   GLintptr Offset[MAX_FEEDBACK_ATTRIBS];
+   GLintptr Offset[MAX_FEEDBACK_BUFFERS];
    /** Max data to put into dest buffer (in bytes) */
-   GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS];
+   GLsizeiptr Size[MAX_FEEDBACK_BUFFERS];
 };
 
 
@@ -2834,9 +2834,10 @@ struct gl_constants
    GLbitfield ProfileMask;   /**< Mask of CONTEXT_x_PROFILE_BIT */
 
    /** GL_EXT_transform_feedback */
-   GLuint MaxTransformFeedbackSeparateAttribs;
+   GLuint MaxTransformFeedbackBuffers;
    GLuint MaxTransformFeedbackSeparateComponents;
    GLuint MaxTransformFeedbackInterleavedComponents;
+   GLuint MaxVertexStreams;
 
    /** GL_EXT_gpu_shader4 */
    GLint MinProgramTexelOffset, MaxProgramTexelOffset;
@@ -2937,6 +2938,7 @@ struct gl_extensions
    GLboolean ARB_texture_storage;
    GLboolean ARB_timer_query;
    GLboolean ARB_transform_feedback2;
+   GLboolean ARB_transform_feedback3;
    GLboolean ARB_transpose_matrix;
    GLboolean ARB_uniform_buffer_object;
    GLboolean ARB_vertex_array_object;
@@ -3200,12 +3202,6 @@ struct gl_dlist_state
    GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX];
    GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4];
 
-   GLubyte ActiveIndex;
-   GLfloat CurrentIndex;
-   
-   GLubyte ActiveEdgeFlag;
-   GLboolean CurrentEdgeFlag;
-
    struct {
       /* State known to have been set by the currently-compiling display
        * list.  Used to eliminate some redundant state changes.