Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_constant_ops.c:
+static bool fold_rsq(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type,
const struct hlsl_ir_constant *src, const struct vkd3d_shader_location *loc)
+{
- enum hlsl_base_type type = dst_type->base_type;
- unsigned int k;
- assert(type == src->node.data_type->base_type);
- for (k = 0; k < dst_type->dimx; ++k)
- {
switch (type)
{
case HLSL_TYPE_FLOAT:
case HLSL_TYPE_HALF:
if (ctx->profile->major_version >= 4 && src->value.u[k].f < 0.0f)
The second half looks wrong, the same checks are done inside the block.