Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.c:
- {
unsigned int p = deref->path_len - 1 - i;
index = hlsl_ir_index(ptr);
if (!hlsl_index_is_crooked_matrix_indexing(index))
{
hlsl_src_from_node(&deref->path[p], index->idx.node);
}
else
{
hlsl_src_from_node(&deref->path[p], deref->path[p + 1].node);
hlsl_src_remove(&deref->path[p + 1]);
hlsl_src_from_node(&deref->path[p + 1], index->idx.node);
}
ptr = index->val.node;
- }
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?
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.)