diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-21 11:37:31 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-21 11:37:31 -0700 |
| commit | 9718ab32e91ba632b03ad8d0f5e89a597b225a4c (patch) | |
| tree | dff607d1927c037f44a6a6fbbf2847f3944f5061 /slang.h | |
| parent | 85f60e07507f347ef4cb613b6d87521ff10e6c81 (diff) | |
Add an API option to control emission of `#line` directives
- API users can use this to get "clean" output to aid with debugging Slang issues
- Also changes the prefix on intermediate files that Slang dumps, to make them easier to ignore with a regexp
Diffstat (limited to 'slang.h')
| -rw-r--r-- | slang.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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: |
