diff options
| author | Yong He <yonghe@outlook.com> | 2024-01-19 18:02:40 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-19 18:02:40 -0800 |
| commit | fdc17a974970559d8ff76d52c3ce40aaa056d441 (patch) | |
| tree | a7b2264776982707b36f901ac50acd4e047fd2bd /source/slang/slang-options.cpp | |
| parent | 84b214389cacde9f3c94d61b3d4ca6a927cecd04 (diff) | |
Add `-fspv-reflect` support. (#3464)
* Add `-fspv-reflect` support.
Closes #3462.
* Fix.
* Fix.
* Remove use of `SPV_GOOGLE_hlsl_functionality1`.
* Fix spirv validation error.
* Fix test.
* Update typename hints.
* Update commandline options doc.
* Remove superfluous empty lines.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 7c442a9d2..c9527bf5e 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -95,6 +95,7 @@ enum class OptionKind VulkanInvertY, VulkanUseEntryPointName, VulkanUseGLLayout, + VulkanEmitReflection, GLSLForceScalarLayout, EnableEffectAnnotations, @@ -512,6 +513,7 @@ void initCommandOptions(CommandOptions& options) { OptionKind::VulkanInvertY, "-fvk-invert-y", nullptr, "Negates (additively inverts) SV_Position.y before writing to stage output."}, { OptionKind::VulkanUseEntryPointName, "-fvk-use-entrypoint-name", nullptr, "Uses the entrypoint name from the source instead of 'main' in the spirv output."}, { OptionKind::VulkanUseGLLayout, "-fvk-use-gl-layout", nullptr, "Use std430 layout instead of D3D buffer layout for raw buffer load/stores."}, + { OptionKind::VulkanEmitReflection, "-fspv-reflect", nullptr, "Include reflection decorations in the resulting SPIRV for shader parameters."}, { OptionKind::EnableEffectAnnotations, "-enable-effect-annotations", nullptr, "Enables support for legacy effect annotation syntax."}, @@ -2100,6 +2102,12 @@ SlangResult OptionsParser::_parse( m_hlslToVulkanLayoutOptions->setUseGLLayout(true); break; } + case OptionKind::VulkanEmitReflection: + { + // -fvk-invert-y + m_hlslToVulkanLayoutOptions->setEmitSPIRVReflectionInfo(true); + break; + } case OptionKind::Profile: SLANG_RETURN_ON_FAIL(_parseProfile(arg)); break; case OptionKind::Capability: { |
