mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-25 07:05:48 +00:00
Apple: support for Output_DebugMon log channel
This commit is contained in:
committed by
Baldur Karlsson
parent
39cdfeb138
commit
1d9be38380
@@ -29,6 +29,7 @@
|
||||
#include <unistd.h>
|
||||
#include "common/common.h"
|
||||
#include "common/formatting.h"
|
||||
#include "core/core.h"
|
||||
#include "os/os_specific.h"
|
||||
|
||||
char **GetCurrentEnvironment()
|
||||
@@ -200,3 +201,10 @@ uint64_t Process::GetMemoryUsage()
|
||||
|
||||
return taskInfo.resident_size;
|
||||
}
|
||||
|
||||
// Helper method to avoid #include file conflicts between
|
||||
// <Carbon/Carbon.h> and "core/core.h"
|
||||
bool ShouldOutputDebugMon()
|
||||
{
|
||||
return OSUtility::DebuggerPresent() && RenderDoc::Inst().IsReplayApp();
|
||||
}
|
||||
|
||||
@@ -318,6 +318,10 @@ rdcwstr UTF82Wide(const rdcstr &s)
|
||||
}
|
||||
};
|
||||
|
||||
// Helper method to avoid #include file conflicts between
|
||||
// <Carbon/Carbon.h> and "core/core.h"
|
||||
bool ShouldOutputDebugMon();
|
||||
|
||||
namespace OSUtility
|
||||
{
|
||||
void WriteOutput(int channel, const char *str)
|
||||
@@ -326,6 +330,8 @@ void WriteOutput(int channel, const char *str)
|
||||
fprintf(stdout, "%s", str);
|
||||
else if(channel == OSUtility::Output_StdErr)
|
||||
fprintf(stderr, "%s", str);
|
||||
else if(channel == OSUtility::Output_DebugMon && ShouldOutputDebugMon())
|
||||
fprintf(stdout, "%s", str);
|
||||
}
|
||||
|
||||
uint64_t GetMachineIdent()
|
||||
|
||||
Reference in New Issue
Block a user