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/slang.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index f67123cc6..1e3d1e716 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1229,6 +1229,15 @@ SLANG_API void spSetTargetFlags( req->targets[targetIndex]->targetFlags = flags; } +SLANG_API void spSetTargetFloatingPointMode( + SlangCompileRequest* request, + int targetIndex, + SlangFloatingPointMode mode) +{ + auto req = REQ(request); + req->targets[targetIndex]->floatingPointMode = Slang::FloatingPointMode(mode); +} + SLANG_API void spSetMatrixLayoutMode( SlangCompileRequest* request, SlangMatrixLayoutMode mode) -- cgit v1.2.3