mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-29 02:41:08 +00:00
Implement DXBC ReplaceChunk adding a new chunk if it's not present
This commit is contained in:
@@ -743,6 +743,20 @@ void DXBCContainer::ReplaceChunk(bytebuf &ByteCode, uint32_t fourcc, const byte
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t newOffs = uint32_t(ByteCode.size() + sizeof(uint32_t));
|
||||
ByteCode.insert(sizeof(FileHeader) + header->numChunks * sizeof(uint32_t), (byte *)&newOffs,
|
||||
sizeof(newOffs));
|
||||
|
||||
for(uint32_t chunkIdx = 0; chunkIdx < header->numChunks; chunkIdx++)
|
||||
chunkOffsets[chunkIdx] += sizeof(uint32_t);
|
||||
|
||||
ByteCode.append(replacement, size);
|
||||
|
||||
header->numChunks++;
|
||||
header->fileLength = (uint32_t)ByteCode.size();
|
||||
|
||||
HashContainer(ByteCode.data(), ByteCode.size());
|
||||
}
|
||||
|
||||
const byte *DXBCContainer::FindChunk(const bytebuf &ByteCode, uint32_t fourcc, size_t &size)
|
||||
|
||||
Reference in New Issue
Block a user