st/mesa: fix a crash due to passing a draw vertex shader into the driver
[mesa.git] / src / mesa / state_tracker / st_glsl_to_tgsi_array_merge.h
index 9e9443c427a1e824d6f8b336a55d5ea191166cf9..15738a817d342e562a0c60719f0e9a00572c9859 100644 (file)
@@ -146,6 +146,9 @@ public:
                            const array_remapping& rhs);
 
 private:
+
+   void interleave(int trgt_access_mask, int src_access_mask);
+
    unsigned target_id;
    int8_t read_swizzle_map[4];
 };
@@ -157,5 +160,29 @@ std::ostream& operator << (std::ostream& os, const array_remapping& am)
    return os;
 }
 
+/* Apply the array remapping (internal use, exposed here for testing) */
+ bool get_array_remapping(int narrays, array_live_range *array_live_ranges,
+                        array_remapping *remapping);
+
+/* Apply the array remapping (internal use, exposed here for testing) */
+int remap_arrays(int narrays, unsigned *array_sizes,
+                exec_list *instructions,
+                array_remapping *map);
+
 }
+
+/** Remap the array access to finalize the array merging and interleaving.
+  * @param[in] narrays number of input arrays,
+  * @param[in,out] array_sizes length array of input arrays, on output the
+  *   array sizes will be updated according to the remapping,
+  * @param[in,out] instructions TGSI program, on output the arrays access is
+  *    remapped to the new array layout,
+  * @param[in] array_live_ranges live ranges and access information of the
+  *    arrays.
+  * @returns number of remaining arrays
+  */
+int merge_arrays(int narrays,
+                unsigned *array_sizes,
+                exec_list *instructions,
+                class array_live_range *arr_live_ranges);
 #endif