https://github.com/shader-slang/slang
Raw File
Tip revision: 259a015feb9d4ab65e8fbba32f6c777e92780cc7 authored by Yong He on 23 March 2023, 04:16:35 UTC
Type legalization and autodiff bug fixes. (#2722)
Tip revision: 259a015
slang-json-diagnostics.cpp
// slang-json-diagnostics.cpp
#include "slang-json-diagnostics.h"

namespace Slang {

namespace JSONDiagnostics
{
#define DIAGNOSTIC(id, severity, name, messageFormat) const DiagnosticInfo name = { id, Severity::severity, #name, messageFormat };
#include "slang-json-diagnostic-defs.h"
#undef DIAGNOSTIC
}

static const DiagnosticInfo* const kJSONDiagnostics[] =
{
#define DIAGNOSTIC(id, severity, name, messageFormat) &JSONDiagnostics::name, 
#include "slang-json-diagnostic-defs.h"
#undef DIAGNOSTIC
};

static DiagnosticsLookup* _newJSONDiagnosticsLookup()
{
    auto lookup = new DiagnosticsLookup;
    lookup->add(kJSONDiagnostics, SLANG_COUNT_OF(kJSONDiagnostics));
    return lookup;
}

DiagnosticsLookup* getJSONDiagnosticsLookup()
{
    static RefPtr<DiagnosticsLookup> s_lookup = _newJSONDiagnosticsLookup();
    return s_lookup;
}

} // namespace Slang
back to top