Fix imported shader source last char value to prevent strange diffs in Version Control Systems

This commit is contained in:
Wojtek Figat
2022-12-27 19:04:09 +01:00
parent cb6590e7ef
commit 9050377526
34 changed files with 69 additions and 67 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -32,12 +32,14 @@ CreateAssetResult ImportShader::Import(CreateAssetContext& context)
LOG(Warning, "Empty shader source file.");
return CreateAssetResult::Error;
}
context.Data.Header.Chunks[SourceCodeChunk]->Data.Allocate(sourceCodeSize + 1);
const auto sourceCode = context.Data.Header.Chunks[SourceCodeChunk]->Get();
const auto& sourceCodeChunk = context.Data.Header.Chunks[SourceCodeChunk];
sourceCodeChunk->Data.Allocate(sourceCodeSize + 1);
const auto sourceCode = sourceCodeChunk->Get();
Platform::MemoryCopy(sourceCode, sourceCodeText.Get(), sourceCodeSize);
// Encrypt source code
Encryption::EncryptBytes(sourceCode, sourceCodeSize);
sourceCode[sourceCodeSize] = 0;
// Set Custom Data with Header
ShaderStorage::Header20 shaderHeader;