nir: Separate 32 and 64-bit fmod lowering
[mesa.git] / src / compiler / glsl_types.h
index 5965cb2eedb974b7adc149a58e7735dc30d9a4fc..a47b0ffe5a24858cae3c93cea5b826f088940210 100644 (file)
@@ -56,11 +56,11 @@ enum glsl_base_type {
    GLSL_TYPE_IMAGE,
    GLSL_TYPE_ATOMIC_UINT,
    GLSL_TYPE_STRUCT,
-   GLSL_TYPE_FUNCTION,
    GLSL_TYPE_INTERFACE,
    GLSL_TYPE_ARRAY,
    GLSL_TYPE_VOID,
    GLSL_TYPE_SUBROUTINE,
+   GLSL_TYPE_FUNCTION,
    GLSL_TYPE_ERROR
 };
 
@@ -122,7 +122,7 @@ struct glsl_type {
    unsigned sampler_dimensionality:3; /**< \see glsl_sampler_dim */
    unsigned sampler_shadow:1;
    unsigned sampler_array:1;
-   unsigned sampler_type:2;    /**< Type of data returned using this
+   unsigned sampled_type:2;    /**< Type of data returned using this
                                * sampler or image.  Only \c
                                * GLSL_TYPE_FLOAT, \c GLSL_TYPE_INT,
                                * and \c GLSL_TYPE_UINT are valid.
@@ -326,6 +326,12 @@ struct glsl_type {
     */
    unsigned uniform_locations() const;
 
+   /**
+    * Used to count the number of varyings contained in the type ignoring
+    * innermost array elements.
+    */
+   unsigned varying_count() const;
+
    /**
     * Calculate the number of attribute slots required to hold this type
     *
@@ -338,7 +344,7 @@ struct glsl_type {
     * For vertex shader attributes - doubles only take one slot.
     * For inter-shader varyings - dvec3/dvec4 take two slots.
     */
-   unsigned count_attribute_slots(bool vertex_input_slots) const;
+   unsigned count_attribute_slots(bool is_vertex_input) const;
 
    /**
     * Alignment in bytes of the start of this type in a std140 uniform
@@ -837,6 +843,26 @@ struct glsl_struct_field {
     */
    int location;
 
+   /**
+    * For interface blocks, members may have an explicit byte offset
+    * specified; -1 otherwise. Also used for xfb_offset layout qualifier.
+    *
+    * Unless used for xfb_offset this field is ignored for structs.
+    */
+   int offset;
+
+   /**
+    * For interface blocks, members may define a transform feedback buffer;
+    * -1 otherwise.
+    */
+   int xfb_buffer;
+
+   /**
+    * For interface blocks, members may define a transform feedback stride;
+    * -1 otherwise.
+    */
+   int xfb_stride;
+
    /**
     * For interface blocks, the interpolation mode (as in
     * ir_variable::interpolation).  0 otherwise.
@@ -881,6 +907,13 @@ struct glsl_struct_field {
    unsigned image_volatile:1;
    unsigned image_restrict:1;
 
+   /**
+    * Any of the xfb_* qualifiers trigger the shader to be in transform
+    * feedback mode so we need to keep track of whether the buffer was
+    * explicitly set or if its just been assigned the default global value.
+    */
+   unsigned explicit_xfb_buffer:1;
+
 #ifdef __cplusplus
    glsl_struct_field(const struct glsl_type *_type, const char *_name)
       : type(_type), name(_name), location(-1), interpolation(0), centroid(0),