Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl_constant_ops.c:
+ "Floating point division by zero."); + } + dst->u[k].f = 1.0f / sqrtf(src->value.u[k].f); + if (ctx->profile->major_version < 4 && !isfinite(dst->u[k].f)) + { + hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_NON_FINITE_RESULT, + "Infinities and NaNs are not allowed by the shader model."); + } + break; + + case HLSL_TYPE_DOUBLE: + if (src->value.u[k].d < 0.0) + { + hlsl_warning(ctx, loc, VKD3D_SHADER_WARNING_HLSL_IMAGINARY_NUMERIC_RESULT, + "Imaginary square root result."); + } Why there is no warning for zero in this case? BTW, did you manage to actually have native execute `rsqrt()` on a `double`? If I try something trivial as
float4 main(uint4 x : COLOR) : sv_target
{
double y = 0.0;
return rsqrt(y);
}
the warnings seem to imply that `y` is casted to `float` before being given to `rsqrt()`. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/368#note_46935