summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-21 11:52:17 -0700
committerGitHub <noreply@github.com>2017-07-21 11:52:17 -0700
commit3fa85ede1a6d532b0e86c8b71d3f37d30c353aad (patch)
treedff607d1927c037f44a6a6fbbf2847f3944f5061 /slang.h
parent85f60e07507f347ef4cb613b6d87521ff10e6c81 (diff)
parent9718ab32e91ba632b03ad8d0f5e89a597b225a4c (diff)
Merge pull request #132 from tfoleyNV/line-directive-control
Add an API option to control emission of `#line` directives
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 a9b69d705..2485a5e57 100644
--- a/slang.h
+++ b/slang.h
@@ -96,6 +96,18 @@ extern "C"
SLANG_COMPILE_FLAG_NO_CHECKING = 1 << 0, /**< Disable semantic checking as much as possible. */
};
+ /*!
+ @brief Options to control emission of `#line` directives
+ */
+ typedef unsigned int SlangLineDirectiveMode;
+ enum
+ {
+ SLANG_LINE_DIRECTIVE_MODE_DEFAULT = 0, /**< Default behavior: pick behavior base on target. */
+ SLANG_LINE_DIRECTIVE_MODE_NONE, /**< Don't emit line directives at all. */
+ SLANG_LINE_DIRECTIVE_MODE_STANDARD, /**< Emit standard C-style `#line` directives. */
+ SLANG_LINE_DIRECTIVE_MODE_GLSL, /**< Emit GLSL-style directives with file *number* instead of name */
+ };
+
typedef int SlangSourceLanguage;
enum
{
@@ -177,6 +189,13 @@ extern "C"
int enable);
/*!
+ @brief Set whether (and how) `#line` directives hsould be output.
+ */
+ SLANG_API void spSetLineDirectiveMode(
+ SlangCompileRequest* request,
+ SlangLineDirectiveMode mode);
+
+ /*!
@brief Sets the target for code generation.
@param ctx The compilation context.
@param target The code generation target. Possible values are: