From 677cd4e382bc7c8af5d1fa006f4d621bc5e66820 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 12 Oct 2023 22:29:11 +0200 Subject: [PATCH] Fix build regression from 6f7f22eb47a1687295c58436925dcf9780008e16 --- Source/Engine/ShadersCompilation/ShadersCompilation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Engine/ShadersCompilation/ShadersCompilation.cpp b/Source/Engine/ShadersCompilation/ShadersCompilation.cpp index b8d51b7b5..de2ba6e54 100644 --- a/Source/Engine/ShadersCompilation/ShadersCompilation.cpp +++ b/Source/Engine/ShadersCompilation/ShadersCompilation.cpp @@ -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 {