diff --git a/Source/ShaderCooker/ShaderCooker/ShaderCompiler.cpp b/Source/ShaderCooker/ShaderCooker/ShaderCompiler.cpp index 29195fb6..9c4fc04d 100644 --- a/Source/ShaderCooker/ShaderCooker/ShaderCompiler.cpp +++ b/Source/ShaderCooker/ShaderCooker/ShaderCompiler.cpp @@ -258,6 +258,8 @@ namespace ShaderCooker } else if (_stageInfo.stage == Stage::COMPILATION) { + ShaderCooker::SlangBridge slangBridge(_sourceDirPath); + for (Shader& shader : _shaders) { if (!shader.hasResolvedIncludes) @@ -269,8 +271,6 @@ namespace ShaderCooker continue; } - ShaderCooker::SlangBridge slangBridge(_sourceDirPath); - // Figure out the actual permutations u32 numPermutationGroups = static_cast(shader.permutationGroups.size()); diff --git a/Source/ShaderCooker/ShaderCooker/SlangBridge.cpp b/Source/ShaderCooker/ShaderCooker/SlangBridge.cpp index ff6a8915..83529eba 100644 --- a/Source/ShaderCooker/ShaderCooker/SlangBridge.cpp +++ b/Source/ShaderCooker/ShaderCooker/SlangBridge.cpp @@ -39,7 +39,7 @@ namespace ShaderCooker SlangBridge::~SlangBridge() { - + delete static_cast(_data); } void SlangBridge::AddDefine(const std::string& name, const std::string& value)