Francisco Casas (@fcasas) commented about libs/vkd3d-shader/hlsl.y:
if (!(args[1] = add_implicit_conversion(ctx, instrs, arg2, common_type, loc))) return NULL;
- if (ctx->profile->major_version < 4 && dim == 2)
- {
struct hlsl_ir_constant *zero;
if (!(zero = hlsl_new_float_constant(ctx, 0.0f, loc)))
return NULL;
if (!(args[2] = add_implicit_conversion(ctx, instrs, &zero->node, common_type, loc)))
return NULL;
- }
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:
```c if (profile->major_version < 4) { transform_ir(ctx, lower_division, body, NULL); transform_ir(ctx, lower_sqrt, body, NULL); } ```