yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakHandle debug-layer messages in a separate channel (#7988)aefd1e3e0

master
1.0 KiB46 linesraw
1// slang-process-util.h
2#ifndef SLANG_PROCESS_UTIL_H
3#define SLANG_PROCESS_UTIL_H
4
5#include "slang-process.h"
6
7namespace Slang
8{
9
10struct ExecuteResult
11{
12    typedef int ResultCode;
13
14    void init()
15    {
16        resultCode = 0;
17        standardOutput = String();
18        standardError = String();
19        debugLayer = String();
20    }
21
22    ResultCode resultCode;
23    String standardOutput;
24    String standardError;
25    String debugLayer;
26};
27
28struct ProcessUtil
29{
30    /// Execute the command line
31    static SlangResult execute(const CommandLine& commandLine, ExecuteResult& outExecuteResult);
32
33    /// Read from read from streams until process terminates.
34    /// Passing nullptr for a stream, will just discard what's in the stream
35    static SlangResult readUntilTermination(
36        Process* process,
37        List<Byte>* outStdOut,
38        List<Byte>* stdError);
39
40    /// Read streams from process.
41    static SlangResult readUntilTermination(Process* process, ExecuteResult& outExecuteResult);
42};
43
44} // namespace Slang
45
46#endif // SLANG_PROCESS_UTIL_H