On 12/2/21 09:26, Giovanni Mascellani wrote:
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com
Though with a few comments...
On 01/12/21 17:14, Matteo Bruni wrote:
+ if (instr->type != HLSL_IR_EXPR) + return false; + cast = hlsl_ir_expr(instr); + src_type = cast->operands[0].node->data_type; + dst_type = cast->node.data_type;
Here operands[0].node is assumed to be valid before we know the operation is checked to be OP1_CAST. I know that we don't have nullary operators and I can't see why we might eventually have one, but I still don't like the idea.
Yes, I suppose I would agree.
+ if (cast->op == HLSL_OP1_CAST + && src_type->type <= HLSL_CLASS_VECTOR && dst_type->type <= HLSL_CLASS_VECTOR + && src_type->dimx == 1)
I don't like how this is formatted. I would either put each conjoint on a dedicated line, or put two in one line and two in another. This 1-2-1 structure makes it more difficult to parse to the eye, at least to my eye.
The mental logic is that it compares "op", then "type" (for both sources), then "dimx". I don't feel strongly about it, though.