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/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/compiler.h') 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; }; + 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 -- cgit v1.2.3