v3d/compiler: Fix sorting the gs and fs inputs
[mesa.git] / src / broadcom / compiler / nir_to_vir.c
index d95361731cb9339a57d9347133c5ecf1bae5daa1..8f568d4779ade6d76ccd3c2483fdfedbd84f3579 100644 (file)
@@ -1460,6 +1460,9 @@ driver_location_compare(const void *in_a, const void *in_b)
         const nir_variable *const *a = in_a;
         const nir_variable *const *b = in_b;
 
+        if ((*a)->data.driver_location == (*b)->data.driver_location)
+                return (*a)->data.location_frac - (*b)->data.location_frac;
+
         return (*a)->data.driver_location - (*b)->data.driver_location;
 }