summaryrefslogtreecommitdiffstats
path: root/source/slang/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/compiler.h')
-rw-r--r--source/slang/compiler.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/slang/compiler.h b/source/slang/compiler.h
index fbd6b3f15..2a9b60d9b 100644
--- a/source/slang/compiler.h
+++ b/source/slang/compiler.h
@@ -212,6 +212,20 @@ namespace Slang
Precise = SLANG_FLOATING_POINT_MODE_PRECISE,
};
+ enum class WriterChannel : SlangWriterChannel
+ {
+ Diagnostic = SLANG_WRITER_CHANNEL_DIAGNOSTIC,
+ StdOutput = SLANG_WRITER_CHANNEL_STD_OUTPUT,
+ StdError = SLANG_WRITER_CHANNEL_STD_ERROR,
+ CountOf = SLANG_WRITER_CHANNEL_COUNT_OF,
+ };
+
+ enum class WriterMode : SlangWriterMode
+ {
+ Text = SLANG_WRITER_MODE_TEXT,
+ Binary = SLANG_WRITER_MODE_BINARY,
+ };
+
// A request to generate output in some target format
class TargetRequest : public RefObject
{
@@ -401,6 +415,12 @@ namespace Slang
/// or a wrapped impl that makes fileSystem operate as fileSystemExt
ComPtr<ISlangFileSystemExt> fileSystemExt;
+ // For output
+ ComPtr<ISlangWriter> m_writers[SLANG_WRITER_CHANNEL_COUNT_OF];
+
+ void setWriter(WriterChannel chan, ISlangWriter* writer);
+ ISlangWriter* getWriter(WriterChannel chan) const { return m_writers[int(chan)]; }
+
/// Load a file into memory using the configured file system.
///
/// @param path The path to attempt to load from