From 24db8dbffc7422610822a9db6934c7868b8a7e48 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 26 Jan 2018 15:29:58 +0000 Subject: [PATCH] Add an 'internal' flag when launching processes, to reduce log spam --- renderdoc/core/android.cpp | 4 ++-- renderdoc/driver/ihv/amd/amd_isa.cpp | 8 ++++---- renderdoc/os/os_specific.h | 4 ++-- renderdoc/os/posix/posix_process.cpp | 6 +++--- renderdoc/os/win32/win32_process.cpp | 22 +++++++++++++--------- renderdoc/replay/app_api.cpp | 2 +- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/renderdoc/core/android.cpp b/renderdoc/core/android.cpp index 206a2a8af..e0fb0afaa 100644 --- a/renderdoc/core/android.cpp +++ b/renderdoc/core/android.cpp @@ -311,7 +311,7 @@ Process::ProcessResult execScript(const string &script, const string &args, RDCLOG("SCRIPT: %s", script.c_str()); Process::ProcessResult result; - Process::LaunchScript(script.c_str(), workDir.c_str(), args.c_str(), &result); + Process::LaunchScript(script.c_str(), workDir.c_str(), args.c_str(), true, &result); return result; } Process::ProcessResult execCommand(const string &exe, const string &args, @@ -320,7 +320,7 @@ Process::ProcessResult execCommand(const string &exe, const string &args, RDCLOG("COMMAND: %s '%s'", exe.c_str(), args.c_str()); Process::ProcessResult result; - Process::LaunchProcess(exe.c_str(), workDir.c_str(), args.c_str(), &result); + Process::LaunchProcess(exe.c_str(), workDir.c_str(), args.c_str(), true, &result); return result; } Process::ProcessResult adbExecCommand(const string &device, const string &args, const string &workDir) diff --git a/renderdoc/driver/ihv/amd/amd_isa.cpp b/renderdoc/driver/ihv/amd/amd_isa.cpp index 75aabed05..fd3bb43ed 100644 --- a/renderdoc/driver/ihv/amd/amd_isa.cpp +++ b/renderdoc/driver/ihv/amd/amd_isa.cpp @@ -51,7 +51,7 @@ static bool IsSupported(ShaderEncoding encoding) std::string vc = LocatePluginFile(pluginPath, virtualcontext_name); Process::ProcessResult result = {}; - Process::LaunchProcess(vc.c_str(), dirname(vc).c_str(), "", &result); + Process::LaunchProcess(vc.c_str(), dirname(vc).c_str(), "", true, &result); // running with no parameters produces an error, so if there's no output something went wrong. if(result.strStdout.empty()) @@ -66,7 +66,7 @@ static bool IsSupported(ShaderEncoding encoding) std::string amdspv = LocatePluginFile(pluginPath, amdspv_name); Process::ProcessResult result = {}; - Process::LaunchProcess(amdspv.c_str(), dirname(amdspv).c_str(), "", &result); + Process::LaunchProcess(amdspv.c_str(), dirname(amdspv).c_str(), "", true, &result); // running with no parameters produces help text, so if there's no output something went wrong. if(result.strStdout.empty()) @@ -195,7 +195,7 @@ std::string DisassembleSPIRV(ShaderStage stage, const bytebuf &shaderBytes, cons std::string amdspv = LocatePluginFile(pluginPath, amdspv_name); Process::ProcessResult result = {}; - Process::LaunchProcess(amdspv.c_str(), dirname(amdspv).c_str(), cmdLine.c_str(), &result); + Process::LaunchProcess(amdspv.c_str(), dirname(amdspv).c_str(), cmdLine.c_str(), true, &result); if(result.strStdout.find("SUCCESS") == std::string::npos) { @@ -348,7 +348,7 @@ std::string DisassembleGLSL(ShaderStage stage, const bytebuf &shaderBytes, const std::string vc = LocatePluginFile(pluginPath, virtualcontext_name); Process::ProcessResult result = {}; - Process::LaunchProcess(vc.c_str(), dirname(vc).c_str(), cmdLine.c_str(), &result); + Process::LaunchProcess(vc.c_str(), dirname(vc).c_str(), cmdLine.c_str(), true, &result); if(result.retCode != 0 || result.strStdout.find("Error") != string::npos || result.strStdout.empty() || !FileIO::exists(outPath.c_str())) diff --git a/renderdoc/os/os_specific.h b/renderdoc/os/os_specific.h index 6a4935b8b..1a0240c85 100644 --- a/renderdoc/os/os_specific.h +++ b/renderdoc/os/os_specific.h @@ -67,9 +67,9 @@ struct ProcessResult string strStdout, strStderror; int retCode; }; -uint32_t LaunchProcess(const char *app, const char *workingDir, const char *cmdLine, +uint32_t LaunchProcess(const char *app, const char *workingDir, const char *cmdLine, bool internal, ProcessResult *result = NULL); -uint32_t LaunchScript(const char *script, const char *workingDir, const char *args, +uint32_t LaunchScript(const char *script, const char *workingDir, const char *args, bool internal, ProcessResult *result = NULL); uint32_t LaunchAndInjectIntoProcess(const char *app, const char *workingDir, const char *cmdLine, const rdcarray &env, const char *logfile, diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp index dc387d523..8c5f90823 100644 --- a/renderdoc/os/posix/posix_process.cpp +++ b/renderdoc/os/posix/posix_process.cpp @@ -417,7 +417,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, const rdcarray