When starting a chunk assert that it starts from 0

Help to catch the mistake of starting a chunk inside an active chunk ie. calling SCOPED_SERIALISE_CHUNK inside an existing SCOPED_SERIALISE_CHUNK
This commit is contained in:
Jake Turner
2021-11-12 05:27:06 +00:00
committed by Baldur Karlsson
parent ae9ce88930
commit a5636c7bec
+3
View File
@@ -341,6 +341,9 @@ void Serialiser<SerialiserMode::Writing>::SetChunkMetadataRecording(uint32_t fla
template <>
uint32_t Serialiser<SerialiserMode::Writing>::BeginChunk(uint32_t chunkID, uint64_t byteLength)
{
// cannot start a chunk inside a chunk
RDCASSERTMSG("Beginning a chunk inside another chunk", m_Write->GetOffset() == 0,
m_Write->GetOffset());
{
// chunk index needs to be valid
RDCASSERT(chunkID > 0);