Maybe it'd be clearer to handle the noncontiguous matrix case by checking if this iteration is a scalar whose parent is a noncontiguous matrix dereference?
Since the loop goes from the component to the variable, rather than the other way around, that would require paying attention to the next iteration, rather than the previous one, and advance `ptr` two steps in that case. I don't think it improves simplicity.
Also, if the previous loop is "while (ptr->type == HLSL_IR_INDEX)", I'd kind of like to make this loop the same, just to make it a bit more idiomatic / clearer that it's the same iteration. (And then one can assert that chain_len == load->src.path_len or something.)
Makes sense, I changed it.