summaryrefslogtreecommitdiffstats
path: root/source/slang/compiler.h
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/compiler.h
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/compiler.h')
-rw-r--r--source/slang/compiler.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/compiler.h b/source/slang/compiler.h
index c62daf228..1f4a4736a 100644
--- a/source/slang/compiler.h
+++ b/source/slang/compiler.h
@@ -203,6 +203,13 @@ namespace Slang
RefPtr<IRModule> irModule;
};
+ enum class FloatingPointMode : SlangFloatingPointMode
+ {
+ Default = SLANG_FLOATING_POINT_MODE_DEFAULT,
+ Fast = SLANG_FLOATING_POINT_MODE_FAST,
+ Precise = SLANG_FLOATING_POINT_MODE_PRECISE,
+ };
+
// A request to generate output in some target format
class TargetRequest : public RefObject
{
@@ -211,6 +218,7 @@ namespace Slang
CodeGenTarget target;
SlangTargetFlags targetFlags = 0;
Slang::Profile targetProfile = Slang::Profile();
+ FloatingPointMode floatingPointMode = FloatingPointMode::Default;
// Requested output paths for each entry point.
// An empty string indices no output desired for