Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl_codegen.c:
- if (instr->type != HLSL_IR_INDEX)
return false;
- index = hlsl_ir_index(instr);
- if (!hlsl_index_is_crooked_matrix_indexing(index))
return false;
- mat = index->val.node;
- assert(!hlsl_type_is_row_major(mat->data_type));
- /* We will remove this instruction but we need to generate nodes that refer to it,
* so we create a copy. */
- if (!(copy = hlsl_new_index(ctx, index->val.node, index->idx.node, &instr->loc)))
return false;
- list_add_before(&instr->entry, ©->node.entry);
Oh, hlsl_replace_node() deletes the old instruction. Hmm, maybe we could introduce a variant that doesn't do that instead?