Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / mesa / state_tracker / st_glsl_to_tgsi_array_merge.cpp
index f95b1fac7b7d4db28ec96ca84e3d0e754d13164e..e54bb7b9f4d8b412d63f6faa35a7178a5b0275ef 100644 (file)
@@ -587,10 +587,10 @@ int remap_arrays(int narrays, unsigned *array_sizes,
    /* re-calculate arrays */
 #if __cplusplus < 201402L
    int *idx_map = new int[narrays + 1];
-   unsigned *old_sizes = new unsigned[narrays + 1];
+   unsigned *old_sizes = new unsigned[narrays];
 #else
    unique_ptr<int[]> idx_map = make_unique<int[]>(narrays + 1);
-   unique_ptr<unsigned[]> old_sizes = make_unique<unsigned[]>(narrays + 1);
+   unique_ptr<unsigned[]> old_sizes = make_unique<unsigned[]>(narrays);
 #endif
 
    memcpy(&old_sizes[0], &array_sizes[0], sizeof(unsigned) * narrays);
@@ -599,9 +599,9 @@ int remap_arrays(int narrays, unsigned *array_sizes,
    int new_narrays = 0;
    for (int i = 1; i <= narrays; ++i) {
       if (!map[i].is_valid()) {
-        ++new_narrays;
-        idx_map[i] = new_narrays;
-        array_sizes[new_narrays] = old_sizes[i];
+         ++new_narrays;
+         array_sizes[new_narrays-1] = old_sizes[i-1];
+         idx_map[i] = new_narrays;
       }
    }
 
@@ -686,7 +686,7 @@ using namespace tgsi_array_merge;
 int  merge_arrays(int narrays,
                  unsigned *array_sizes,
                  exec_list *instructions,
-                 struct array_live_range *arr_live_ranges)
+                 class array_live_range *arr_live_ranges)
 {
    array_remapping *map= new array_remapping[narrays + 1];