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 /slang.h | |
| 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 'slang.h')
| -rw-r--r-- | slang.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -451,6 +451,17 @@ extern "C" }; /*! + @brief Options to control floating-point precision guarantees for a target. + */ + typedef unsigned int SlangFloatingPointMode; + enum + { + SLANG_FLOATING_POINT_MODE_DEFAULT = 0, + SLANG_FLOATING_POINT_MODE_FAST, + SLANG_FLOATING_POINT_MODE_PRECISE, + }; + + /*! @brief Options to control emission of `#line` directives */ typedef unsigned int SlangLineDirectiveMode; @@ -877,6 +888,14 @@ extern "C" int targetIndex, SlangTargetFlags flags); + /*! + @brief Set the floating point mode (e.g., precise or fast) to use a target. + */ + SLANG_API void spSetTargetFloatingPointMode( + SlangCompileRequest* request, + int targetIndex, + SlangFloatingPointMode mode); + /* DEPRECATED: use `spSetMatrixLayoutMode` instead. */ SLANG_API void spSetTargetMatrixLayoutMode( SlangCompileRequest* request, |
