summaryrefslogtreecommitdiffstats
path: root/source/slang/dxc-support.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-11-01 15:08:54 -0700
committerGitHub <noreply@github.com>2018-11-01 15:08:54 -0700
commit453331951b0df2a612f9bc0d68eab2ad786ec5bf (patch)
tree5514782a6c8247941d5aa3396930aa479e504db9 /source/slang/dxc-support.cpp
parent82f57ae3561e9f9e8ece8ab6c12c2b318580bc38 (diff)
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).
Diffstat (limited to 'source/slang/dxc-support.cpp')
-rw-r--r--source/slang/dxc-support.cpp10
1 files changed, 10 insertions, 0 deletions
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