summaryrefslogtreecommitdiff
path: root/slang.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 /slang.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 'slang.h')
-rw-r--r--slang.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 83aece07f..f774ab323 100644
--- a/slang.h
+++ b/slang.h
@@ -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,