Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_constant_ops.c:
return true;
}
+static bool fold_dot(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type,
const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2)
+{
- enum hlsl_base_type type = dst_type->base_type;
- unsigned int k;
- assert(type == src1->node.data_type->base_type);
- assert(type == src2->node.data_type->base_type);
- assert(src1->node.data_type->dimx == src2->node.data_type->dimx);
- assert(type == HLSL_TYPE_FLOAT || type == HLSL_TYPE_HALF);
This is not wrong, given that at this point all dot operations on other types should already have been lowered, but it is inconsistent with the other operations, for which unknown types are just logged with `FIXME()` and ignored. I think it should be better to do the same here, so in case this pass is used in other places than `hlsl_emit_bytecode()` we don't `assert()` for no real reason.