glsl: remove tabs from linker.{cpp,h}
[mesa.git] / src / compiler / glsl / link_varyings.h
index b2812614eccc1d52e75022491ab75ff5d2822cc8..afce56e52213b9d1d4f580fc3a16c52114083bb7 100644 (file)
@@ -98,7 +98,8 @@ public:
    unsigned get_num_outputs() const;
    bool store(struct gl_context *ctx, struct gl_shader_program *prog,
               struct gl_transform_feedback_info *info, unsigned buffer,
-              const unsigned max_outputs) const;
+              unsigned buffer_index, const unsigned max_outputs,
+              bool *explicit_stride, bool has_xfb_qualifiers) const;
    const tfeedback_candidate *find_candidate(gl_shader_program *prog,
                                              hash_table *tfeedback_candidates);
 
@@ -107,6 +108,14 @@ public:
       return this->next_buffer_separator;
    }
 
+   bool is_varying_written() const
+   {
+      if (this->next_buffer_separator || this->skip_components)
+         return false;
+
+      return this->matched_candidate->toplevel_var->data.assigned;
+   }
+
    bool is_varying() const
    {
       return !this->next_buffer_separator && !this->skip_components;
@@ -122,6 +131,16 @@ public:
       return this->stream_id;
    }
 
+   unsigned get_buffer() const
+   {
+      return this->buffer;
+   }
+
+   unsigned get_offset() const
+   {
+      return this->offset;
+   }
+
    /**
     * The total number of varying components taken up by this variable.  Only
     * valid if assign_location() has been called.
@@ -132,7 +151,7 @@ public:
          return this->size;
       else
          return this->vector_elements * this->matrix_columns * this->size *
-            (this->is_double() ? 2 : 1);
+            (this->is_64bit() ? 2 : 1);
    }
 
    unsigned get_location() const {
@@ -141,7 +160,7 @@ public:
 
 private:
 
-   bool is_double() const
+   bool is_64bit() const
    {
       switch (this->type) {
       case GL_DOUBLE:
@@ -191,6 +210,7 @@ private:
    enum {
       none,
       clip_distance,
+      cull_distance,
       tess_level_outer,
       tess_level_inner,
    } lowered_builtin_array_variable;
@@ -201,6 +221,16 @@ private:
     */
    int location;
 
+   /**
+    * Used to store the buffer assigned by xfb_buffer.
+    */
+   unsigned buffer;
+
+   /**
+    * Used to store the offset assigned by xfb_offset.
+    */
+   unsigned offset;
+
    /**
     * If non-zero, then this variable may be packed along with other variables
     * into a single varying slot, so this offset should be applied when
@@ -261,39 +291,54 @@ private:
 
 void
 cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
-                                gl_shader *producer, gl_shader *consumer);
+                                 gl_linked_shader *producer,
+                                 gl_linked_shader *consumer);
 
 bool
 parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog,
                       const void *mem_ctx, unsigned num_names,
                       char **varying_names, tfeedback_decl *decls);
 
+bool
+process_xfb_layout_qualifiers(void *mem_ctx, const gl_linked_shader *sh,
+                              unsigned *num_tfeedback_decls,
+                              char ***varying_names);
+
 void
 remove_unused_shader_inputs_and_outputs(bool is_separate_shader_object,
-                                        gl_shader *sh,
+                                        gl_linked_shader *sh,
                                         enum ir_variable_mode mode);
 
 bool
 store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,
                      unsigned num_tfeedback_decls,
-                     tfeedback_decl *tfeedback_decls);
+                     tfeedback_decl *tfeedback_decls,
+                     bool has_xfb_qualifiers);
 
 bool
 assign_varying_locations(struct gl_context *ctx,
                         void *mem_ctx,
                         struct gl_shader_program *prog,
-                        gl_shader *producer, gl_shader *consumer,
+                         gl_linked_shader *producer,
+                         gl_linked_shader *consumer,
                          unsigned num_tfeedback_decls,
-                         tfeedback_decl *tfeedback_decls);
+                         tfeedback_decl *tfeedback_decls,
+                         const uint64_t reserved_slots);
+
+uint64_t
+reserved_varying_slot(struct gl_linked_shader *stage,
+                      ir_variable_mode io_mode);
 
 bool
 check_against_output_limit(struct gl_context *ctx,
                            struct gl_shader_program *prog,
-                           gl_shader *producer);
+                           gl_linked_shader *producer,
+                           unsigned num_explicit_locations);
 
 bool
 check_against_input_limit(struct gl_context *ctx,
                           struct gl_shader_program *prog,
-                          gl_shader *consumer);
+                          gl_linked_shader *consumer,
+                          unsigned num_explicit_locations);
 
 #endif /* GLSL_LINK_VARYINGS_H */