diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-11-01 15:08:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-01 15:08:54 -0700 |
| commit | 453331951b0df2a612f9bc0d68eab2ad786ec5bf (patch) | |
| tree | 5514782a6c8247941d5aa3396930aa479e504db9 /source/slang/slang.cpp | |
| parent | 82f57ae3561e9f9e8ece8ab6c12c2b318580bc38 (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/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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) |
