Skip to content

Commit e030acc

Browse files
committed
Fix issue when multiple inline constants using same pInlineConstantData.
1 parent 9f796b6 commit e030acc

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Graphics/GraphicsEngineVulkan/src/ShaderResourceCacheVk.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -975,16 +975,14 @@ const void* ShaderResourceCacheVk::GetInlineConstantData(Uint32 DescrSetIndex, U
975975
{
976976
const DescriptorSet& DescrSet = GetDescriptorSet(DescrSetIndex);
977977

978-
// Find the resource with the matching binding index
979-
for (Uint32 i = 0; i < DescrSet.GetSize(); ++i)
978+
VERIFY(BindingIndex < DescrSet.GetSize(), "BindingIndex out of bounds");
979+
980+
const Resource& Res = DescrSet.GetResource(BindingIndex);
981+
if (Res.pInlineConstantData != nullptr)
980982
{
981-
const Resource& Res = DescrSet.GetResource(i);
982-
if (Res.pInlineConstantData != nullptr)
983-
{
984-
// For now, we assume binding index matches the resource index for inline constants
985-
// This may need adjustment based on actual binding layout
986-
return Res.pInlineConstantData;
987-
}
983+
// For now, we assume binding index matches the resource index for inline constants
984+
// This may need adjustment based on actual binding layout
985+
return Res.pInlineConstantData;
988986
}
989987

990988
return nullptr;

0 commit comments

Comments
 (0)