Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/ir.c:
signature = normaliser->output_signature;
break;
default:
return;
- }
- id_idx = reg->idx_count - 1;
- reg_idx = reg->idx[id_idx].offset;
- write_mask = VKD3DSP_WRITEMASK_0 << vkd3d_swizzle_get_component(src_param->swizzle, 0);
- element_idx = shader_signature_find_element_for_reg(signature, reg_idx, write_mask);
- e = &signature->elements[element_idx];
- if ((e->register_count > 1 || sysval_semantic_is_tess_factor(e->sysval_semantic)))
id_idx = shader_register_normalise_arrayed_addressing(reg, id_idx, e->register_index);
- reg->idx[id_idx].offset = element_idx;
- reg->idx_count = id_idx + 1;
I guess that putting `element_idx` in the last index slot is intended, to match the code that would be generated by the SM6 parser, isn't it? Because in itself it feels pretty ugly, since it swaps the natural order of array dimensions (i.e., putting major dimensions first).