nir/lower_system_values: Stop supporting non-SSA
[mesa.git] / src / glsl / link_varyings.h
index daa9d79c94f133a33c5728989ef79bd55e96d1c8..2ce72d43d8496f045c7ab4302fcde1bcca8a976c 100644 (file)
@@ -91,8 +91,7 @@ struct tfeedback_candidate
 class tfeedback_decl
 {
 public:
-   void init(struct gl_context *ctx, struct gl_shader_program *prog,
-             const void *mem_ctx, const char *input);
+   void init(struct gl_context *ctx, const void *mem_ctx, const char *input);
    static bool is_same(const tfeedback_decl &x, const tfeedback_decl &y);
    bool assign_location(struct gl_context *ctx,
                         struct gl_shader_program *prog);
@@ -113,18 +112,32 @@ public:
       return !this->next_buffer_separator && !this->skip_components;
    }
 
+   const char *name() const
+   {
+      return this->orig_name;
+   }
+
+   unsigned get_stream_id() const
+   {
+      return this->stream_id;
+   }
+
    /**
     * The total number of varying components taken up by this variable.  Only
     * valid if assign_location() has been called.
     */
    unsigned num_components() const
    {
-      if (this->is_clip_distance_mesa)
+      if (this->lowered_builtin_array_variable)
          return this->size;
       else
          return this->vector_elements * this->matrix_columns * this->size;
    }
 
+   unsigned get_location() const {
+      return this->location;
+   }
+
 private:
    /**
     * The name that was supplied to glTransformFeedbackVaryings.  Used for
@@ -148,10 +161,15 @@ private:
    unsigned array_subscript;
 
    /**
-    * True if the variable is gl_ClipDistance and the driver lowers
-    * gl_ClipDistance to gl_ClipDistanceMESA.
+    * Non-zero if the variable is gl_ClipDistance, glTessLevelOuter or
+    * gl_TessLevelInner and the driver lowers it to gl_*MESA.
     */
-   bool is_clip_distance_mesa;
+   enum {
+      none,
+      clip_distance,
+      tess_level_outer,
+      tess_level_inner,
+   } lowered_builtin_array_variable;
 
    /**
     * The vertex shader output location that the linker assigned for this
@@ -207,10 +225,17 @@ private:
     * data structure that was found.  Otherwise NULL.
     */
    const tfeedback_candidate *matched_candidate;
+
+   /**
+    * StreamId assigned to this varying (defaults to 0). Can only be set to
+    * values other than 0 in geometry shaders that use the stream layout
+    * modifier. Accepted values must be in the range [0, MAX_VERTEX_STREAMS-1].
+    */
+   unsigned stream_id;
 };
 
 
-bool
+void
 cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
                                 gl_shader *producer, gl_shader *consumer);
 
@@ -233,8 +258,13 @@ assign_varying_locations(struct gl_context *ctx,
                          tfeedback_decl *tfeedback_decls);
 
 bool
-check_against_varying_limit(struct gl_context *ctx,
-                            struct gl_shader_program *prog,
-                            gl_shader *consumer);
+check_against_output_limit(struct gl_context *ctx,
+                           struct gl_shader_program *prog,
+                           gl_shader *producer);
+
+bool
+check_against_input_limit(struct gl_context *ctx,
+                          struct gl_shader_program *prog,
+                          gl_shader *consumer);
 
 #endif /* GLSL_LINK_VARYINGS_H */