From 453331951b0df2a612f9bc0d68eab2ad786ec5bf Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 1 Nov 2018 15:08:54 -0700 Subject: Add support for a "strict" floating-point mode (#709) This change adds an API function and command line options for controlling the default floating-point behavior for a target, with options for "fast" and "precise" computation. The "precise" option gets mapped to the "IEEE strictness" mode in `fxc` and `dxc` (there is currently no equivalent option for glslang that I could find). --- source/slang/dxc-support.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/dxc-support.cpp') diff --git a/source/slang/dxc-support.cpp b/source/slang/dxc-support.cpp index 7c42ad242..0478eef25 100644 --- a/source/slang/dxc-support.cpp +++ b/source/slang/dxc-support.cpp @@ -132,6 +132,16 @@ namespace Slang break; } + switch( targetReq->floatingPointMode ) + { + default: + break; + + case FloatingPointMode::Precise: + args[argCount++] = L"-Gis"; // "force IEEE strictness" + break; + } + // Slang strives to produce correct code, and by default // we do not show the user warnings produced by a downstream // compiler. When the downstream compiler *does* produce an -- cgit v1.2.3