From ea1f1653896163d0f3aadc35f7fedf3d8102a71b Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 8 Aug 2023 13:54:05 -0700 Subject: Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store. (#3068) * Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store. * Fix. * Fix. * Add test for unaligned load. --------- 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 b31a502e7..dbd6b97a4 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -94,6 +94,7 @@ enum class OptionKind VulkanBindGlobals, VulkanInvertY, VulkanUseEntryPointName, + VulkanUseGLLayout, GLSLForceScalarLayout, @@ -501,6 +502,7 @@ void initCommandOptions(CommandOptions& options) "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::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::EnableEffectAnnotations, "-enable-effect-annotations", nullptr, "Enables support for legacy effect annotation syntax."}, @@ -2025,6 +2027,12 @@ SlangResult OptionsParser::_parse( m_hlslToVulkanLayoutOptions->setUseOriginalEntryPointName(true); break; } + case OptionKind::VulkanUseGLLayout: + { + // -fvk-use-gl-layout + m_hlslToVulkanLayoutOptions->setUseGLLayout(true); + break; + } case OptionKind::Profile: SLANG_RETURN_ON_FAIL(_parseProfile(arg)); break; case OptionKind::Capability: { -- cgit v1.2.3