From 15d1c6c51c5f24663d2567d7e56da62a2bca1c22 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 30 Sep 2024 12:50:30 -0700 Subject: Add COM API for querying metadata. (#5168) * Add COM API for querying metadata. * Fix tests. * fix test. --- source/slang/slang-parameter-binding.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-parameter-binding.cpp') diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp index ea22cbcba..5d3331c6f 100644 --- a/source/slang/slang-parameter-binding.cpp +++ b/source/slang/slang-parameter-binding.cpp @@ -1225,10 +1225,6 @@ static void addExplicitParameterBindings_GLSL( } } - // We use the HLSL binding directly (even though this notionally for GLSL/Vulkan) - // We'll do the shifting at later later point in _maybeApplyHLSLToVulkanShifts - info[kResInfo].resInfo = typeLayout->findOrAddResourceInfo(hlslInfo.kind); - if (warnedMissingVulkanLayoutModifier) { // If we warn due to invalid bindings and user did not set how to interpret 'hlsl style bindings', we should map @@ -1236,7 +1232,7 @@ static void addExplicitParameterBindings_GLSL( if(!hlslToVulkanLayoutOptions || hlslToVulkanLayoutOptions->getKindShiftEnabledFlags() == HLSLToVulkanLayoutOptions::KindFlag::None) { - info[kResInfo].resInfo->kind = LayoutResourceKind::DescriptorTableSlot; + info[kResInfo].resInfo = typeLayout->findOrAddResourceInfo(LayoutResourceKind::DescriptorTableSlot); info[kResInfo].resInfo->count = 1; } else @@ -1245,6 +1241,11 @@ static void addExplicitParameterBindings_GLSL( } } + // We use the HLSL binding directly (even though this notionally for GLSL/Vulkan) + // We'll do the shifting at later later point in _maybeApplyHLSLToVulkanShifts + if (!info[kResInfo].resInfo) + info[kResInfo].resInfo = typeLayout->findOrAddResourceInfo(hlslInfo.kind); + info[kResInfo].semanticInfo.kind = info[kResInfo].resInfo->kind; info[kResInfo].semanticInfo.index = UInt(hlslInfo.index); info[kResInfo].semanticInfo.space = UInt(hlslInfo.space); -- cgit v1.2.3