yum-mirror/slang

Making it easier to work with shaders

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

Ellie Hermaszewskaformatf65d756bf

master
896 B34 linesraw
1// slang-json-diagnostics.cpp
2#include "slang-json-diagnostics.h"
3
4namespace Slang
5{
6
7namespace JSONDiagnostics
8{
9#define DIAGNOSTIC(id, severity, name, messageFormat) \
10    const DiagnosticInfo name = {id, Severity::severity, #name, messageFormat};
11#include "slang-json-diagnostic-defs.h"
12#undef DIAGNOSTIC
13} // namespace JSONDiagnostics
14
15static const DiagnosticInfo* const kJSONDiagnostics[] = {
16#define DIAGNOSTIC(id, severity, name, messageFormat) &JSONDiagnostics::name,
17#include "slang-json-diagnostic-defs.h"
18#undef DIAGNOSTIC
19};
20
21static DiagnosticsLookup* _newJSONDiagnosticsLookup()
22{
23    auto lookup = new DiagnosticsLookup;
24    lookup->add(kJSONDiagnostics, SLANG_COUNT_OF(kJSONDiagnostics));
25    return lookup;
26}
27
28DiagnosticsLookup* getJSONDiagnosticsLookup()
29{
30    static RefPtr<DiagnosticsLookup> s_lookup = _newJSONDiagnosticsLookup();
31    return s_lookup;
32}
33
34} // namespace Slang