[DXIL] Null pointer exception due to double
floating-point literals in fmod
intrinsic
#6410
Labels
bug
Bug, regression, crash
crash
DXC crashing or hitting an assert
rca
Candidate for a root cause analysis discussion
sm6.8
Shader Model 6.8
validation
Related to validation or signing
Milestone
Description
There is a null pointer exception during the translation of FMod (
TranslateFMod
) when the arguments are floating-point literals, because the latest DXC version does not reduce them tofloat
during compilation. The null pointer occurs insideTrivialDxilUnaryOperation(OP::OpCode::Frc, absDiv, hlslOP, Builder)
becauseFrc
won't find the respective function for double-precision floats. Previous versions had this assertion in OP::GetOpFunc:But the latest version only returns a null pointer that is not handled correctly:
Steps to Reproduce
This issue can be reproduced with the latest version of the main branch and compiling with
dxc -E PSMain -T ps_6_0
(or by following https://godbolt.org/z/beK7oPsx6):Making the floating-point literals explicitly single-precision with the
f
suffix compiles fine:This does not reproduce with other intrinsics such as
sin
.The text was updated successfully, but these errors were encountered: