glsl: document varying_matches::assign_locations() params and return value
authorBrian Paul <brianp@vmware.com>
Fri, 15 Dec 2017 22:08:17 +0000 (15:08 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 20 Dec 2017 18:23:16 +0000 (11:23 -0700)
And change *components to components[] as a reminder that it's an array.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/link_varyings.cpp

index a1c2d424d40aa2e92ea6e2e4e2eca32fb7c7352a..7f42f8a2150386974b7b99eab36d4dcf8b30ab3d 100644 (file)
@@ -1468,7 +1468,7 @@ public:
    ~varying_matches();
    void record(ir_variable *producer_var, ir_variable *consumer_var);
    unsigned assign_locations(struct gl_shader_program *prog,
-                             uint8_t *components,
+                             uint8_t components[],
                              uint64_t reserved_slots);
    void store_locations() const;
 
@@ -1742,10 +1742,15 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
 /**
  * Choose locations for all of the variable matches that were previously
  * passed to varying_matches::record().
+ * \param components  returns array[slot] of number of components used
+ *                    per slot (1, 2, 3 or 4)
+ * \param reserved_slots  bitmask indicating which varying slots are already
+ *                        allocated
+ * \return number of slots (4-element vectors) allocated
  */
 unsigned
 varying_matches::assign_locations(struct gl_shader_program *prog,
-                                  uint8_t *components,
+                                  uint8_t components[],
                                   uint64_t reserved_slots)
 {
    /* If packing has been disabled then we cannot safely sort the varyings by