diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-09 11:34:21 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-09 13:44:59 -0700 |
| commit | fcf83dbf9effab3bd98bad2b83b2468b7eb05cfd (patch) | |
| tree | 41047c94883b86ec085a81597391ce3ef557cd43 /source/slang/compiled-program.h | |
| parent | 52e8d4b9a27ab0060f874c3a63ab531847be35c0 (diff) | |
Initial import of code.
Diffstat (limited to 'source/slang/compiled-program.h')
| -rw-r--r-- | source/slang/compiled-program.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/source/slang/compiled-program.h b/source/slang/compiled-program.h new file mode 100644 index 000000000..7a86dfe90 --- /dev/null +++ b/source/slang/compiled-program.h @@ -0,0 +1,96 @@ +#ifndef BAKER_SL_COMPILED_PROGRAM_H +#define BAKER_SL_COMPILED_PROGRAM_H + +#include "../core/basic.h" +#include "diagnostics.h" +#include "syntax.h" +#include "type-layout.h" + +namespace Slang +{ + namespace Compiler + { +#if 0 + class ShaderMetaData + { + public: + CoreLib::String ShaderName; + CoreLib::EnumerableDictionary<CoreLib::String, CoreLib::RefPtr<ILModuleParameterSet>> ParameterSets; // bindingName->DescSet + }; + + class StageSource + { + public: + String MainCode; + List<unsigned char> BinaryCode; + }; + + class CompiledShaderSource + { + public: + EnumerableDictionary<String, StageSource> Stages; + ShaderMetaData MetaData; + }; +#endif + + void IndentString(StringBuilder & sb, String src); + + struct EntryPointResult + { + String outputSource; + }; + + struct TranslationUnitResult + { + String outputSource; + List<EntryPointResult> entryPoints; + }; + + class CompileResult + { + public: + DiagnosticSink* mSink = nullptr; + +#if 0 + String ScheduleFile; + RefPtr<ILProgram> Program; + EnumerableDictionary<String, CompiledShaderSource> CompiledSource; // shader -> stage -> code +#endif + + // Per-translation-unit results + List<TranslationUnitResult> translationUnits; + +#if 0 + void PrintDiagnostics() + { + for (int i = 0; i < sink.diagnostics.Count(); i++) + { + fprintf(stderr, "%S(%d): %s %d: %S\n", + sink.diagnostics[i].Position.FileName.ToWString(), + sink.diagnostics[i].Position.Line, + getSeverityName(sink.diagnostics[i].severity), + sink.diagnostics[i].ErrorID, + sink.diagnostics[i].Message.ToWString()); + } + } +#endif + + CompileResult() + {} + ~CompileResult() + { + } + DiagnosticSink * GetErrorWriter() + { + return mSink; + } + int GetErrorCount() + { + return mSink->GetErrorCount(); + } + }; + + } +} + +#endif
\ No newline at end of file |
