Optimize Vulkan shader compiler memory allocation

This commit is contained in:
Wojtek Figat
2021-06-07 11:56:41 +02:00
parent cc47cb85e4
commit fa1cd56a0d
3 changed files with 17 additions and 5 deletions

View File

@@ -364,6 +364,21 @@ bool ShaderCompiler::WriteShaderFunctionBegin(ShaderCompilationContext* context,
return false;
}
bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* header, int32 headerSize, const void* cache, int32 cacheSize)
{
auto output = context->Output;
// [Output] Write compiled shader cache
output->WriteUint32(cacheSize + headerSize);
output->WriteBytes(header, headerSize);
output->WriteBytes(cache, cacheSize);
// [Output] Shader bindings meta
output->Write(&bindings);
return false;
}
bool ShaderCompiler::WriteShaderFunctionPermutation(ShaderCompilationContext* context, ShaderFunctionMeta& meta, int32 permutationIndex, const ShaderBindings& bindings, const void* cache, int32 cacheSize)
{
auto output = context->Output;