summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-parameter-binding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-parameter-binding.cpp')
-rw-r--r--source/slang/slang-parameter-binding.cpp11
1 files changed, 6 insertions, 5 deletions
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);