summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-type-text-util.cpp13
-rw-r--r--source/core/slang-type-text-util.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/source/core/slang-type-text-util.cpp b/source/core/slang-type-text-util.cpp
index 9f55b69e2..39b68db45 100644
--- a/source/core/slang-type-text-util.cpp
+++ b/source/core/slang-type-text-util.cpp
@@ -171,6 +171,14 @@ static const NamesDescriptionValue s_floatingPointModes[] = {
"by the target."},
{SLANG_FLOATING_POINT_MODE_DEFAULT, "default", "Default floating point mode"}};
+static const NamesDescriptionValue s_fpDenormalModes[] = {
+ {SLANG_FP_DENORM_MODE_ANY,
+ "any",
+ "Use any denormal handling mode (default). The mode used is implementation defined."},
+ {SLANG_FP_DENORM_MODE_PRESERVE, "preserve", "Preserve denormal values"},
+ {SLANG_FP_DENORM_MODE_FTZ, "ftz", "Flush denormals to zero"},
+};
+
static const NamesDescriptionValue s_optimizationLevels[] = {
{SLANG_OPTIMIZATION_LEVEL_NONE, "0,none", "Disable all optimizations"},
{SLANG_OPTIMIZATION_LEVEL_DEFAULT,
@@ -253,6 +261,11 @@ static const NamesDescriptionValue s_fileSystemTypes[] = {
return makeConstArrayView(s_floatingPointModes);
}
+/* static */ ConstArrayView<NamesDescriptionValue> TypeTextUtil::getFpDenormalModeInfos()
+{
+ return makeConstArrayView(s_fpDenormalModes);
+}
+
/* static */ ConstArrayView<NamesDescriptionValue> TypeTextUtil::getOptimizationLevelInfos()
{
return makeConstArrayView(s_optimizationLevels);
diff --git a/source/core/slang-type-text-util.h b/source/core/slang-type-text-util.h
index eddbcec5e..684d109c3 100644
--- a/source/core/slang-type-text-util.h
+++ b/source/core/slang-type-text-util.h
@@ -45,6 +45,8 @@ struct TypeTextUtil
static ConstArrayView<NamesDescriptionValue> getDebugLevelInfos();
/// Get the floating point modes
static ConstArrayView<NamesDescriptionValue> getFloatingPointModeInfos();
+ /// Get the floating point denormal handling modes
+ static ConstArrayView<NamesDescriptionValue> getFpDenormalModeInfos();
// Get the line directive infos
static ConstArrayView<NamesDescriptionValue> getLineDirectiveInfos();
/// Get the optimization level info