mesa: minor whitespace fixes in teximage.c
[mesa.git] / src / mesa / main / mtypes.h
index f9cec2453dfe35598f4fe49b859bc5f8033bc74f..40a802f52e6cd2cfa44bc189904544c0bf8357f2 100644 (file)
@@ -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.
@@ -1290,12 +1250,8 @@ struct gl_sampler_object
    GLfloat MaxAnisotropy;      /**< GL_EXT_texture_filter_anisotropic */
    GLenum CompareMode;         /**< GL_ARB_shadow */
    GLenum CompareFunc;         /**< GL_ARB_shadow */
-   GLfloat CompareFailValue;    /**< GL_ARB_shadow_ambient */
    GLenum sRGBDecode;           /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */
    GLboolean CubeMapSeamless;   /**< GL_AMD_seamless_cubemap_per_texture */
-
-   /* deprecated sampler state */
-   GLenum DepthMode;           /**< GL_ARB_depth_texture */
 };
 
 
@@ -1312,6 +1268,8 @@ struct gl_texture_object
 
    struct gl_sampler_object Sampler;
 
+   GLenum DepthMode;           /**< GL_ARB_depth_texture */
+
    GLfloat Priority;           /**< in [0,1] */
    GLint BaseLevel;            /**< min mipmap level, OpenGL 1.2 */
    GLint MaxLevel;             /**< max mipmap level, OpenGL 1.2 */
@@ -1366,6 +1324,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 +1793,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 +1810,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];
 };
 
 
@@ -2011,6 +2009,7 @@ struct gl_fragment_program
 {
    struct gl_program Base;   /**< base class */
    GLboolean UsesKill;          /**< shader uses KIL instruction */
+   GLboolean UsesDFdy;          /**< shader uses DDY instruction */
    GLboolean OriginUpperLeft;
    GLboolean PixelCenterInteger;
    enum gl_frag_depth_layout FragDepthLayout;
@@ -2215,6 +2214,15 @@ struct gl_shader
     */
    unsigned num_uniform_components;
 
+   /**
+    * This shader's uniform block information.
+    *
+    * The offsets of the variables are assigned only for shaders in a program's
+    * _LinkedShaders[].
+    */
+   struct gl_uniform_block *UniformBlocks;
+   unsigned NumUniformBlocks;
+
    struct exec_list *ir;
    struct glsl_symbol_table *symbols;
 
@@ -2236,6 +2244,37 @@ typedef enum
    MESA_SHADER_TYPES = 3
 } gl_shader_type;
 
+struct gl_uniform_buffer_variable
+{
+   char *Name;
+   const struct glsl_type *Type;
+   unsigned int Buffer;
+   unsigned int Offset;
+   GLboolean RowMajor;
+};
+
+struct gl_uniform_block
+{
+   /** Declared name of the uniform block */
+   char *Name;
+
+   /** Array of supplemental information about UBO ir_variables. */
+   struct gl_uniform_buffer_variable *Uniforms;
+   GLuint NumUniforms;
+
+   /**
+    * Index (GL_UNIFORM_BLOCK_BINDING) into ctx->UniformBufferBindings[] to use
+    * with glBindBufferBase to bind a buffer object to this uniform block.  When
+    * updated in the program, _NEW_BUFFER_OBJECT will be set.
+    */
+   GLuint Binding;
+
+   /**
+    * Minimum size of a buffer object to back this uniform buffer
+    * (GL_UNIFORM_BLOCK_DATA_SIZE).
+    */
+   GLuint UniformBufferSize;
+};
 
 /**
  * A GLSL program object.
@@ -2319,6 +2358,18 @@ struct gl_shader_program
    unsigned NumUserUniformStorage;
    struct gl_uniform_storage *UniformStorage;
 
+   struct gl_uniform_block *UniformBlocks;
+   unsigned NumUniformBlocks;
+
+   /**
+    * Indices into the _LinkedShaders's UniformBlocks[] array for each stage
+    * they're used in, or -1.
+    *
+    * This is used to maintain the Binding values of the stage's UniformBlocks[]
+    * and to answer the GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries.
+    */
+   int *UniformBlockStageIndex[MESA_SHADER_TYPES];
+
    /**
     * Map of active uniform names to locations
     *
@@ -2769,6 +2820,14 @@ struct gl_constants
    GLuint MaxProgramMatrices;
    GLuint MaxProgramMatrixStackDepth;
 
+   struct {
+      GLuint SamplesPassed;
+      GLuint TimeElapsed;
+      GLuint Timestamp;
+      GLuint PrimitivesGenerated;
+      GLuint PrimitivesWritten;
+   } QueryCounterBits;
+
    /** vertex array / buffer object bounds checking */
    GLboolean CheckArrayBounds;
 
@@ -2834,9 +2893,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;
@@ -2886,6 +2946,7 @@ struct gl_extensions
    GLboolean dummy;  /* don't remove this! */
    GLboolean dummy_true;  /* Set true by _mesa_init_extensions(). */
    GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */
+   GLboolean ANGLE_texture_compression_dxt;
    GLboolean ARB_ES2_compatibility;
    GLboolean ARB_base_instance;
    GLboolean ARB_blend_func_extended;
@@ -2912,7 +2973,6 @@ struct gl_extensions
    GLboolean ARB_occlusion_query;
    GLboolean ARB_occlusion_query2;
    GLboolean ARB_point_sprite;
-   GLboolean ARB_sampler_objects;
    GLboolean ARB_seamless_cube_map;
    GLboolean ARB_shader_bit_encoding;
    GLboolean ARB_shader_objects;
@@ -2920,7 +2980,6 @@ struct gl_extensions
    GLboolean ARB_shader_texture_lod;
    GLboolean ARB_shading_language_100;
    GLboolean ARB_shadow;
-   GLboolean ARB_shadow_ambient;
    GLboolean ARB_sync;
    GLboolean ARB_texture_border_clamp;
    GLboolean ARB_texture_buffer_object;
@@ -2937,9 +2996,10 @@ struct gl_extensions
    GLboolean ARB_texture_storage;
    GLboolean ARB_timer_query;
    GLboolean ARB_transform_feedback2;
+   GLboolean ARB_transform_feedback3;
+   GLboolean ARB_transform_feedback_instanced;
    GLboolean ARB_transpose_matrix;
    GLboolean ARB_uniform_buffer_object;
-   GLboolean ARB_vertex_array_object;
    GLboolean ARB_vertex_program;
    GLboolean ARB_vertex_shader;
    GLboolean ARB_vertex_type_2_10_10_10_rev;
@@ -2992,7 +3052,6 @@ struct gl_extensions
    /* vendor extensions */
    GLboolean AMD_seamless_cubemap_per_texture;
    GLboolean APPLE_packed_pixels;
-   GLboolean APPLE_vertex_array_object;
    GLboolean APPLE_object_purgeable;
    GLboolean ATI_envmap_bumpmap;
    GLboolean ATI_texture_compression_3dc;
@@ -3200,12 +3259,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.
@@ -3284,9 +3337,10 @@ struct gl_debug_state
  */
 typedef enum
 {
-   API_OPENGL,
+   API_OPENGL,      /* legacy / compatibility contexts */
    API_OPENGLES,
-   API_OPENGLES2
+   API_OPENGLES2,
+   API_OPENGL_CORE,
 } gl_api;
 
 /**
@@ -3349,8 +3403,6 @@ struct gl_context
     */
    struct dd_function_table Driver;
 
-   void *DriverCtx;    /**< Points to device driver context/state */
-
    /** Core/Driver constants */
    struct gl_constants Const;
 
@@ -3375,8 +3427,8 @@ struct gl_context
    /** Extension information */
    struct gl_extensions Extensions;
 
-   /** Version info */
-   GLuint VersionMajor, VersionMinor;
+   /** GL version integer, for example 31 for GL 3.1, or 20 for GLES 2.0. */
+   GLuint Version;
    char *VersionString;
 
    /** \name State attribute stack (for glPush/PopAttrib) */