From 0e478443815c62c6d6cd042fbbeaeceeb6830478 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 Jul 2023 15:03:42 -0700 Subject: Add support for `-fvk-invert-y`. (#3012) Co-authored-by: Yong He --- source/slang/slang-options.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index dd4473497..e59109b37 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -92,6 +92,7 @@ enum class OptionKind VulkanBindShift, VulkanBindGlobals, + VulkanInvertY, GLSLForceScalarLayout, EnableEffectAnnotations, @@ -496,6 +497,7 @@ void initCommandOptions(CommandOptions& options) "* [GLSL wiki](https://github.com/KhronosGroup/glslang/wiki/HLSL-FAQ#auto-mapped-binding-numbers)\n" }, { OptionKind::VulkanBindGlobals, "-fvk-bind-globals", "-fvk-bind-globals ", "Places the $Globals cbuffer at descriptor set and binding ."}, + { OptionKind::VulkanInvertY, "-fvk-invert-y", nullptr, "Negates (additively inverts) SV_Position.y before writing to stage output."}, { OptionKind::EnableEffectAnnotations, "-enable-effect-annotations", nullptr, "Enables support for legacy effect annotation syntax."}, @@ -2008,6 +2010,12 @@ SlangResult OptionsParser::_parse( m_hlslToVulkanLayoutOptions->setGlobalsBinding(Index(bindingSet), Index(binding)); break; } + case OptionKind::VulkanInvertY: + { + // -fvk-invert-y + m_hlslToVulkanLayoutOptions->setInvertY(true); + break; + } case OptionKind::Profile: SLANG_RETURN_ON_FAIL(_parseProfile(arg)); break; case OptionKind::Capability: { -- cgit v1.2.3