Fix build regression from 6f7f22eb47

This commit is contained in:
Wojtek Figat
2023-10-12 22:29:11 +02:00
parent 88eca13eb3
commit 677cd4e382

View File

@@ -28,6 +28,8 @@
#include "Engine/ContentImporters/AssetsImportingManager.h"
#include "Engine/Platform/FileSystemWatcher.h"
#include "Engine/Platform/FileSystem.h"
#include "Engine/Platform/File.h"
#include "Engine/Engine/Globals.h"
#include "Editor/Editor.h"
#include "Editor/ProjectInfo.h"
#endif
@@ -145,6 +147,7 @@ bool ShadersCompilation::Compile(ShaderCompilationOptions& options)
if (result)
{
#if USE_EDITOR
// Output shader source to easily investigate errors (eg. for generated shaders like materials or particles)
const String outputSourceFolder = Globals::ProjectCacheFolder / TEXT("/Shaders/Source");
const String outputSourcePath = outputSourceFolder / options.TargetName + TEXT(".hlsl");
@@ -153,6 +156,7 @@ bool ShadersCompilation::Compile(ShaderCompilationOptions& options)
File::WriteAllBytes(outputSourcePath, (const byte*)options.Source, options.SourceLength);
LOG(Error, "Shader compilation '{0}' failed (profile: {1})", options.TargetName, ::ToString(options.Profile));
LOG(Error, "Source: {0}", outputSourcePath);
#endif
}
else
{