Fix null character at shader sources at during game cooking

This commit is contained in:
Wojtek Figat
2021-01-05 14:15:32 +01:00
parent 199683897a
commit f5b9a95522

View File

@@ -323,6 +323,8 @@ bool ProcessShaderBase(CookAssetsStep::AssetCookData& data, ShaderAssetBase* ass
auto sourceLength = sourceChunk->Size();
Encryption::DecryptBytes((byte*)source, sourceLength);
source[sourceLength - 1] = 0;
while (sourceLength > 2 && source[sourceLength - 1] == 0)
sourceLength--;
// Init shader cache output stream
// TODO: reuse MemoryWriteStream per cooking process to reduce dynamic memory allocations