diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp index 8ce11ec70..e0baaa9cb 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp @@ -273,7 +273,12 @@ bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result) #else #error "Unknown platform." #endif - platformDefine.Definition = nullptr; + platformDefine.Definition = "1"; +#if USE_EDITOR + auto& editorDefine = options.Macros.AddOne(); + editorDefine.Name = "USE_EDITOR"; + editorDefine.Definition = "1"; +#endif InitCompilationOptions(options); if (ShadersCompilation::Compile(options)) { diff --git a/Source/Engine/ShadersCompilation/Parser/ShaderFunctionReader.h b/Source/Engine/ShadersCompilation/Parser/ShaderFunctionReader.h index 9179426e8..644dc3c58 100644 --- a/Source/Engine/ShadersCompilation/Parser/ShaderFunctionReader.h +++ b/Source/Engine/ShadersCompilation/Parser/ShaderFunctionReader.h @@ -367,14 +367,14 @@ namespace ShaderProcessing { // Visible shader } - else if (token == "false" || token == "0") + else if (token == "false" || token == "0" || token.Length == 0) { // Hidden shader current.Flags = ShaderFlags::Hidden; } else { - parser->OnError(TEXT("Invalid shader function \'isVisible\' option value.")); + parser->OnError(String::Format(TEXT("Invalid shader function \'isVisible\' option value \'{0}\'."), String(token.ToString()))); return; } text.ReadToken(&token); @@ -415,7 +415,7 @@ namespace ShaderProcessing void OnParseAfter(IShaderParser* parser, Reader& text) override { auto& current = ShaderMetaReaderType::_current; - + // Validate amount of permutations if (current.Permutations.Count() > SHADER_PERMUTATIONS_MAX_COUNT) {