Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / glsl / ast.h
index b0430de071ee7305c4b1735c105b2c6ad44ff6d6..c52e518334df44b3dd11b7c580c204a1d72a710b 100644 (file)
@@ -189,6 +189,7 @@ enum ast_operators {
    ast_uint_constant,
    ast_float_constant,
    ast_bool_constant,
+   ast_double_constant,
 
    ast_sequence,
    ast_aggregate
@@ -236,6 +237,7 @@ public:
       float float_constant;
       unsigned uint_constant;
       int bool_constant;
+      double double_constant;
    } primary_expression;
 
 
@@ -509,7 +511,13 @@ struct ast_type_qualifier {
          /** \name Layout qualifiers for GL_ARB_gpu_shader5 */
          /** \{ */
          unsigned invocations:1;
+         unsigned stream:1; /**< Has stream value assigned  */
+         unsigned explicit_stream:1; /**< stream value assigned explicitly by shader code */
          /** \} */
+
+         /** \name Vulkan qualifiers */
+         unsigned vk_set:1;
+
       }
       /** \brief Set of flags, accessed by name. */
       q;
@@ -542,6 +550,9 @@ struct ast_type_qualifier {
    /** Maximum output vertices in GLSL 1.50 geometry shaders. */
    int max_vertices;
 
+   /** Stream in GLSL 1.50 geometry shaders. */
+   unsigned stream;
+
    /** Input or output primitive type in GLSL 1.50 geometry shaders */
    GLenum prim_type;
 
@@ -588,6 +599,11 @@ struct ast_type_qualifier {
     */
    glsl_base_type image_base_type;
 
+   /**
+    * Vulkan descriptor set
+    */
+   int set;
+
    /**
     * Return true if and only if an interpolation qualifier is present.
     */
@@ -635,19 +651,6 @@ class ast_declarator_list;
 
 class ast_struct_specifier : public ast_node {
 public:
-   /**
-    * \brief Make a shallow copy of an ast_struct_specifier.
-    *
-    * Use only if the objects are allocated from the same context and will not
-    * be modified. Zeros the inherited ast_node's fields.
-    */
-   ast_struct_specifier(const ast_struct_specifier& that):
-      ast_node(), name(that.name), declarations(that.declarations),
-      is_declaration(that.is_declaration)
-   {
-      /* empty */
-   }
-
    ast_struct_specifier(const char *identifier,
                        ast_declarator_list *declarator_list);
    virtual void print(void) const;
@@ -665,22 +668,6 @@ public:
 
 class ast_type_specifier : public ast_node {
 public:
-   /**
-    * \brief Make a shallow copy of an ast_type_specifier, specifying array
-    *        fields.
-    *
-    * Use only if the objects are allocated from the same context and will not
-    * be modified. Zeros the inherited ast_node's fields.
-    */
-   ast_type_specifier(const ast_type_specifier *that,
-                      ast_array_specifier *array_specifier)
-      : ast_node(), type_name(that->type_name), structure(that->structure),
-        array_specifier(array_specifier),
-        default_precision(that->default_precision)
-   {
-      /* empty */
-   }
-
    /** Construct a type specifier from a type name */
    ast_type_specifier(const char *name) 
       : type_name(name), structure(NULL), array_specifier(NULL),
@@ -746,13 +733,11 @@ public:
    exec_list declarations;
 
    /**
-    * Special flag for vertex shader "invariant" declarations.
-    *
-    * Vertex shaders can contain "invariant" variable redeclarations that do
-    * not include a type.  For example, "invariant gl_Position;".  This flag
-    * is used to note these cases when no type is specified.
+    * Flags for redeclarations. In these cases, no type is specified, to
+    * `type` is allowed to be NULL. In all other cases, this would be an error.
     */
-   int invariant;
+   int invariant;     /** < `invariant` redeclaration */
+   int precise;       /** < `precise` redeclaration */
 };