On Fri Jan 27 16:18:29 2023 +0000, Francisco Casas wrote:
I don't think it is a good idea to keep the zero constant as a hidden third parameter of `HLSL_OP2_DOT` during the whole compilation. Others may disagree, but I think it may be better to introduce it in a new compilation pass in `hlsl_emit_bytecode()` inside this block:
if (profile->major_version < 4) { transform_ir(ctx, lower_division, body, NULL); transform_ir(ctx, lower_sqrt, body, NULL); }
This is of course possible, but that would mean we'll have to introduce specific HLSL_OP2_DP2..4, or maybe DP2 and DOT that looks less consistent. I used SM4 variant as an example, but if suggested way is desirable, I can do that.