Skip to content

Commit

Permalink
Fixed assert in VulkanDynamicBuffer::flush() on Sample_DynamicGeometr…
Browse files Browse the repository at this point in the history
…y launching
  • Loading branch information
eugenegff committed Dec 5, 2024
1 parent 0e0cdb0 commit 4057a3b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions RenderSystems/Vulkan/src/Vao/OgreVulkanBufferInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,15 @@ namespace Ogre

char *retVal = (char *)mMappedPtr;

// For persistent maps, we've mapped the whole 3x size of the buffer. mLastMappingStart
// points to the right offset so that we can later flush correctly.
size_t lastMappingStart =
elementStart + mBuffer->_getInternalNumElements() * dynamicCurrentFrame;
mBuffer->mLastMappingStart = lastMappingStart;
retVal += lastMappingStart * bytesPerElement;
if( mBuffer->mBufferType >= BT_DYNAMIC_PERSISTENT )
{
// For persistent maps, we've mapped the whole 3x size of the buffer. mLastMappingStart
// points to the right offset so that we can later flush correctly.
size_t lastMappingStart =
elementStart + mBuffer->_getInternalNumElements() * dynamicCurrentFrame;
mBuffer->mLastMappingStart = lastMappingStart;
retVal += lastMappingStart * bytesPerElement;
}

return retVal;
}
Expand Down

0 comments on commit 4057a3b

Please sign in to comment.