microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Special fp value get wrong result for fmod

python3kgae opened this issue · 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