Skip to content

Commit 2335562

Browse files
committed
1 parent b155663 commit 2335562

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

Graphics/GraphicsEngineVulkan/src/PipelineResourceSignatureVkImpl.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,13 +1146,18 @@ void PipelineResourceSignatureVkImpl::CommitInlineConstants(const CommitInlineCo
11461146
}
11471147
else
11481148
{
1149-
VERIFY_EXPR(InlineCBAttr.pBuffer);
1149+
// Get the buffer from the SRB cache (not from the signature's InlineCBAttr.pBuffer).
11501150

1151-
// Map the shared buffer and copy the data
1151+
const ShaderResourceCacheVk::DescriptorSet& DescrSet = ResourceCache.GetDescriptorSet(InlineCBAttr.DescrSet);
1152+
const ShaderResourceCacheVk::Resource& CachedRes = DescrSet.GetResource(InlineCBAttr.SRBCacheOffset);
1153+
BufferVkImpl* pBuffer = CachedRes.pObject.RawPtr<BufferVkImpl>();
1154+
VERIFY(pBuffer != nullptr, "Inline constant buffer is null in SRB cache");
1155+
1156+
// Map the buffer from SRB cache and copy the data
11521157
void* pMappedData = nullptr;
1153-
Attribs.Ctx.MapBuffer(InlineCBAttr.pBuffer, MAP_WRITE, MAP_FLAG_DISCARD, pMappedData);
1158+
Attribs.Ctx.MapBuffer(pBuffer, MAP_WRITE, MAP_FLAG_DISCARD, pMappedData);
11541159
memcpy(pMappedData, pInlineConstantData, DataSize);
1155-
Attribs.Ctx.UnmapBuffer(InlineCBAttr.pBuffer, MAP_WRITE);
1160+
Attribs.Ctx.UnmapBuffer(pBuffer, MAP_WRITE);
11561161
}
11571162
}
11581163
}

0 commit comments

Comments
 (0)