diff --git a/Source/Engine/Engine/CommandLine.cpp b/Source/Engine/Engine/CommandLine.cpp index 744060288..e2de230ef 100644 --- a/Source/Engine/Engine/CommandLine.cpp +++ b/Source/Engine/Engine/CommandLine.cpp @@ -145,9 +145,7 @@ bool CommandLine::Parse(const Char* cmdLine) PARSE_BOOL_SWITCH("-monolog ", MonoLog); PARSE_BOOL_SWITCH("-mute ", Mute); PARSE_BOOL_SWITCH("-lowdpi ", LowDPI); - #if USE_EDITOR - PARSE_BOOL_SWITCH("-clearcache ", ClearCache); PARSE_BOOL_SWITCH("-clearcooker ", ClearCookerCache); PARSE_ARG_SWITCH("-project ", Project); @@ -156,9 +154,10 @@ bool CommandLine::Parse(const Char* cmdLine) PARSE_ARG_SWITCH("-build ", Build); PARSE_BOOL_SWITCH("-skipcompile ", SkipCompile); PARSE_BOOL_SWITCH("-shaderdebug ", ShaderDebug); - PARSE_BOOL_SWITCH("-shaderprofile ", ShaderProfile); PARSE_ARG_OPT_SWITCH("-play ", Play); - +#endif +#if USE_EDITOR || !BUILD_RELEASE + PARSE_BOOL_SWITCH("-shaderprofile ", ShaderProfile); #endif return false; diff --git a/Source/Engine/Engine/CommandLine.h b/Source/Engine/Engine/CommandLine.h index aac3000e9..347e9bebd 100644 --- a/Source/Engine/Engine/CommandLine.h +++ b/Source/Engine/Engine/CommandLine.h @@ -128,7 +128,6 @@ public: Nullable LowDPI; #if USE_EDITOR - /// /// -project !path! (Startup project path) /// @@ -169,16 +168,17 @@ public: /// Nullable ShaderDebug; - /// - /// -shaderprofile (enables debugging data generation for shaders but leaves shader compiler optimizations active for performance profiling) - /// - Nullable ShaderProfile; - /// /// -play !guid! ( Scene to play, can be empty to use default ) /// Nullable Play; +#endif +#if USE_EDITOR || !BUILD_RELEASE + /// + /// -shaderprofile (enables debugging data generation for shaders but leaves shader compiler optimizations active for performance profiling) + /// + Nullable ShaderProfile; #endif }; diff --git a/Source/Engine/Graphics/Graphics.cpp b/Source/Engine/Graphics/Graphics.cpp index 057cc0229..020d0ad0e 100644 --- a/Source/Engine/Graphics/Graphics.cpp +++ b/Source/Engine/Graphics/Graphics.cpp @@ -188,9 +188,14 @@ bool GraphicsService::Init() ); // Initialize - if (device->IsDebugToolAttached || - CommandLine::Options.ShaderProfile || - CommandLine::Options.ShaderDebug) + if (device->IsDebugToolAttached +#if USE_EDITOR || !BUILD_RELEASE + || CommandLine::Options.ShaderProfile +#endif +#if USE_EDITOR + || CommandLine::Options.ShaderDebug +#endif + ) { #if COMPILE_WITH_PROFILER // Auto-enable GPU events