Skip to content

Commit 5be06fb

Browse files
HnRenderPass: do not call UnmapBuffer if the buffer failed to map
1 parent 8a9e68e commit 5be06fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Hydrogent/src/HnRenderPass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,10 @@ HnRenderPass::EXECUTE_RESULT HnRenderPass::Execute(HnRenderPassState& RPState, c
445445
size_t DataSize) {
446446
if (BuffDesc.Usage == USAGE_DYNAMIC)
447447
{
448-
VERIFY_EXPR(pMappedData != nullptr);
449-
pCtx->UnmapBuffer(pBuffer, MAP_WRITE);
448+
if (pMappedData != nullptr)
449+
{
450+
pCtx->UnmapBuffer(pBuffer, MAP_WRITE);
451+
}
450452
pMappedData = nullptr;
451453
}
452454
else
@@ -598,7 +600,7 @@ HnRenderPass::EXECUTE_RESULT HnRenderPass::Execute(HnRenderPassState& RPState, c
598600
pCtx->MapBuffer(pBuffer, MAP_WRITE, MAP_FLAG_DISCARD, pMappedData);
599601
if (pMappedData == nullptr)
600602
{
601-
UNEXPECTED("Failed to map the buffer");
603+
LOG_DVP_ERROR_MESSAGE("Failed to map buffer '", BuffDesc.Name, "'.");
602604
return nullptr;
603605
}
604606
}

0 commit comments

Comments
 (0)