summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/compiler-core/slang-test-server-protocol.cpp1
-rw-r--r--source/compiler-core/slang-test-server-protocol.h1
-rw-r--r--source/core/slang-process-util.h2
-rw-r--r--source/core/slang-std-writers.h25
4 files changed, 29 insertions, 0 deletions
diff --git a/source/compiler-core/slang-test-server-protocol.cpp b/source/compiler-core/slang-test-server-protocol.cpp
index 4b1f210d1..a9a0c5420 100644
--- a/source/compiler-core/slang-test-server-protocol.cpp
+++ b/source/compiler-core/slang-test-server-protocol.cpp
@@ -36,6 +36,7 @@ static const StructRttiInfo _makeExecutionResultRtti()
StructRttiBuilder builder(&obj, "TestServerProtocol::ExecutionResult", nullptr);
builder.addField("stdOut", &obj.stdOut);
builder.addField("stdError", &obj.stdError);
+ builder.addField("debugLayer", &obj.debugLayer);
builder.addField("result", &obj.result);
builder.addField("returnCode", &obj.returnCode);
return builder.make();
diff --git a/source/compiler-core/slang-test-server-protocol.h b/source/compiler-core/slang-test-server-protocol.h
index 7d7ad2389..f0e8dcab1 100644
--- a/source/compiler-core/slang-test-server-protocol.h
+++ b/source/compiler-core/slang-test-server-protocol.h
@@ -42,6 +42,7 @@ struct ExecutionResult
{
String stdOut;
String stdError;
+ String debugLayer;
int32_t result = SLANG_OK;
int32_t returnCode = 0; ///< As returned if invoked as command line
diff --git a/source/core/slang-process-util.h b/source/core/slang-process-util.h
index 25cf0aca3..6c765b6cd 100644
--- a/source/core/slang-process-util.h
+++ b/source/core/slang-process-util.h
@@ -16,11 +16,13 @@ struct ExecuteResult
resultCode = 0;
standardOutput = String();
standardError = String();
+ debugLayer = String();
}
ResultCode resultCode;
String standardOutput;
String standardError;
+ String debugLayer;
};
struct ProcessUtil
diff --git a/source/core/slang-std-writers.h b/source/core/slang-std-writers.h
index bb67d9d9c..bb38d12e0 100644
--- a/source/core/slang-std-writers.h
+++ b/source/core/slang-std-writers.h
@@ -7,6 +7,27 @@
namespace Slang
{
+enum class DebugMessageType
+{
+ Info,
+ Warning,
+ Error
+};
+
+enum class DebugMessageSource
+{
+ Layer,
+ Driver,
+ Slang
+};
+
+class IDebugCallback
+{
+public:
+ virtual SLANG_NO_THROW void SLANG_MCALL
+ handleMessage(DebugMessageType type, DebugMessageSource source, const char* message) = 0;
+};
+
/* Holds standard writers for the channels */
class StdWriters : public RefObject
{
@@ -14,6 +35,9 @@ public:
ISlangWriter* getWriter(SlangWriterChannel chan) const { return m_writers[chan]; }
void setWriter(SlangWriterChannel chan, ISlangWriter* writer) { m_writers[chan] = writer; }
+ IDebugCallback* getDebugCallback() const { return m_debugCallback; }
+ void setDebugCallback(IDebugCallback* callback) { m_debugCallback = callback; }
+
/// Flush all the set writers
void flushWriters();
@@ -42,6 +66,7 @@ public:
protected:
ComPtr<ISlangWriter> m_writers[SLANG_WRITER_CHANNEL_COUNT_OF];
+ IDebugCallback* m_debugCallback = nullptr;
static StdWriters* s_singleton;
};