DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Special fp value get wrong result for fmod

Open python3kgae opened this issue 1 year ago • 0 comments

Description

fmod with special input get wrong result.

Steps to Reproduce

dxc -Tvs_6_0

RWBuffer<float4> results;

[shader("vertex")]
void main() {
      // Explicit float
      // 0.0, -0.0, NaN, -NaN
      results[0] = float4(fmod(0.0f, 1.0f),
                                        fmod(-0.0f, 1.0f),
                         fmod(5.5f, 0.0f),
                         fmod(-5.5f, 0.0f));
}

Actual Behavior

0.0, 0.0, 0.0, 0.0 is stored into result[0].

Environment

  • DXC version : 1.8
  • Host Operating System : Windows

python3kgae avatar Apr 25 '24 18:04 python3kgae