diff options
Diffstat (limited to 'tools')
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/CMakeLists.txt | 0 | ||||
-rwxr-xr-x | tools/buildHeaders/bin/makeHeaders | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/header.cpp | 170 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/header.h | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/jsonToSpirv.cpp | 33 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/jsonToSpirv.h | 36 | ||||
-rwxr-xr-x[-rw-r--r--] | tools/buildHeaders/main.cpp | 20 |
7 files changed, 54 insertions, 221 deletions
diff --git a/tools/buildHeaders/CMakeLists.txt b/tools/buildHeaders/CMakeLists.txt index c624151..c624151 100644..100755 --- a/tools/buildHeaders/CMakeLists.txt +++ b/tools/buildHeaders/CMakeLists.txt diff --git a/tools/buildHeaders/bin/makeHeaders b/tools/buildHeaders/bin/makeHeaders index 47d2218..bf2c615 100755 --- a/tools/buildHeaders/bin/makeHeaders +++ b/tools/buildHeaders/bin/makeHeaders @@ -2,4 +2,4 @@ cd ../../include/spirv/unified1 ../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json -dos2unix spirv.* SpirV.* spv.* +dos2unix spirv.* diff --git a/tools/buildHeaders/header.cpp b/tools/buildHeaders/header.cpp index e1e05d0..b8b227f 100644..100755 --- a/tools/buildHeaders/header.cpp +++ b/tools/buildHeaders/header.cpp @@ -1,19 +1,19 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. -// +// Copyright (c) 2014-2018 The Khronos Group Inc. +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), // to deal in the Materials without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Materials, and to permit persons to whom the // Materials are furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Materials. -// +// // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -42,7 +42,6 @@ #include <cctype> #include <vector> #include <utility> -#include <set> #include "jsoncpp/dist/json/json.h" @@ -69,7 +68,7 @@ namespace { TPrinter(); static const int DocMagicNumber = 0x07230203; - static const int DocVersion = 0x00010400; + static const int DocVersion = 0x00010300; static const int DocRevision = 1; #define DocRevisionString "1" static const std::string DocCopyright; @@ -98,8 +97,7 @@ namespace { virtual void printEpilogue(std::ostream&) const { } virtual void printMeta(std::ostream&) const; virtual void printTypes(std::ostream&) const { } - virtual void printHasResultType(std::ostream&) const { }; - + virtual std::string escapeComment(const std::string& s) const; // Default printComments() uses these comment strings @@ -109,7 +107,7 @@ namespace { virtual std::string commentEOL(bool isLast) const { return ""; } typedef std::pair<unsigned, std::string> valpair_t; - + // for printing enum values virtual std::string enumBeg(const std::string&, enumStyle_t) const { return ""; } virtual std::string enumEnd(const std::string&, enumStyle_t, bool isLast = false) const { @@ -128,7 +126,7 @@ namespace { const char* fmt, bool isLast = false) const { return ""; } - + std::vector<valpair_t> getSortedVals(const Json::Value&) const; virtual std::string indent(int count = 1) const { @@ -151,7 +149,7 @@ namespace { } void addComment(Json::Value& node, const std::string& str); - + Json::Value spvRoot; // JSON SPIR-V data }; @@ -169,7 +167,7 @@ namespace { } const std::string TPrinter::DocCopyright = - "Copyright (c) 2014-2019 The Khronos Group Inc.\n" + "Copyright (c) 2014-2018 The Khronos Group Inc.\n" "\n" "Permission is hereby granted, free of charge, to any person obtaining a copy\n" "of this software and/or associated documentation files (the \"Materials\"),\n" @@ -199,16 +197,13 @@ namespace { const std::string TPrinter::DocComment2 = "Enumeration tokens for SPIR-V, in various styles:\n" - " C, C++, C++11, JSON, Lua, Python, C#, D\n" + " C, C++, C++11, JSON, Lua, Python\n" "\n" "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL\n" "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL\n" "- C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL\n" "- Lua will use tables, e.g.: spv.SourceLanguage.GLSL\n" "- Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']\n" - "- C# will use enum classes in the Specification class located in the \"Spv\" namespace,\n" - " e.g.: Spv.Specification.SourceLanguage.GLSL\n" - "- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL\n" "\n" "Some tokens act like mask values, which can be OR'd together,\n" "while others are mutually exclusive. The mask-like ones have\n" @@ -295,7 +290,7 @@ namespace { { const int commentCount = spvRoot["spv"]["meta"]["Comment"].size(); int commentNum = 0; - + for (const auto& comment : spvRoot["spv"]["meta"]["Comment"]) { out << commentBeg(); @@ -327,7 +322,7 @@ namespace { void TPrinter::printDefs(std::ostream& out) const { const Json::Value& enums = spvRoot["spv"]["enum"]; - + for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { const bool isMask = (*opClass)["Type"].asString() == "Bit"; const auto opName = (*opClass)["Name"].asString(); @@ -342,13 +337,13 @@ namespace { out << enumFmt(opPrefix, valpair_t(0, "MaskNone"), enumNoMask); const auto sorted = getSortedVals((*opClass)["Values"]); - - std::string maxEnum = maxEnumFmt(opName, valpair_t(0x7FFFFFFF, "Max"), enumHex); + + std::string maxEnum = maxEnumFmt(opName, valpair_t(0x7FFFFFFF, "Max"), enumHex); bool printMax = (style != enumMask && maxEnum.size() > 0); for (const auto& v : sorted) - out << enumFmt(opPrefix, v, style, !printMax && v.second == sorted.back().second); + out << enumFmt(opPrefix, v, style, !printMax && v.first == sorted.back().first); if (printMax) out << maxEnum; @@ -366,7 +361,6 @@ namespace { printTypes(out); printMeta(out); printDefs(out); - printHasResultType(out); printEpilogue(out); } @@ -396,7 +390,7 @@ namespace { } return newStr; } - + std::string fmtConstInt(unsigned val, const std::string& name, const char* fmt, bool isLast) const override { return indent(3) + '"' + name + "\": " + fmtNum("%d", val) + (isLast ? "\n" : ",\n"); @@ -481,7 +475,7 @@ namespace { } virtual void printEpilogue(std::ostream& out) const override { - out << "#endif" << std::endl; + out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl; } virtual void printTypes(std::ostream& out) const override { @@ -494,48 +488,9 @@ namespace { return std::string("static const unsigned int ") + pre() + name + " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); } - + virtual std::string pre() const { return ""; } // C name prefix virtual std::string headerGuardSuffix() const = 0; - - virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return pre() + name; } - - virtual void printHasResultType(std::ostream& out) const - { - const Json::Value& enums = spvRoot["spv"]["enum"]; - - std::set<unsigned> seenValues; - - for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) { - const auto opName = (*opClass)["Name"].asString(); - if (opName != "Op") { - continue; - } - - out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl; - out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl; - out << " *hasResult = *hasResultType = false;" << std::endl; - out << " switch (opcode) {" << std::endl; - out << " default: /* unknown opcode */ break;" << std::endl; - - for (auto& inst : spv::InstructionDesc) { - - // Filter out duplicate enum values, which would break the switch statement. - // These are probably just extension enums promoted to core. - if (seenValues.find(inst.value) != seenValues.end()) { - continue; - } - seenValues.insert(inst.value); - - std::string name = inst.name; - out << " case " << fmtEnumUse("Op", name) << ": *hasResult = " << (inst.hasResult() ? "true" : "false") << "; *hasResultType = " << (inst.hasType() ? "true" : "false") << "; break;" << std::endl; - } - - out << " }" << std::endl; - out << "}" << std::endl; - out << "#endif /* SPV_ENABLE_UTILITY_CODE */" << std::endl << std::endl; - } - } }; // C printer @@ -587,19 +542,19 @@ namespace { if (isMask) { const auto typeName = opName + styleStr(enumMask); - + out << "inline " + typeName + " operator|(" + typeName + " a, " + typeName + " b) { return " + typeName + "(unsigned(a) | unsigned(b)); }\n"; } } out << "\n} // end namespace spv\n\n"; - out << "#endif // #ifndef spirv_" << headerGuardSuffix() << std::endl; + TPrinterCBase::printEpilogue(out); } std::string commentBOL() const override { return "// "; } - + virtual std::string enumBeg(const std::string& s, enumStyle_t style) const override { return std::string("enum ") + s + styleStr(style) + " {\n"; } @@ -642,9 +597,6 @@ namespace { return enumFmt(s, v, style, true); } - // Add type prefix for scoped enum - virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return opPrefix + "::" + name; } - std::string headerGuardSuffix() const override { return "HPP"; } }; @@ -706,76 +658,6 @@ namespace { } }; - // C# printer - class TPrinterCSharp final : public TPrinter { - private: - std::string commentBOL() const override { return "// "; } - - void printPrologue(std::ostream& out) const override { - out << "namespace Spv\n{\n\n"; - out << indent() << "public static class Specification\n"; - out << indent() << "{\n"; - } - - void printEpilogue(std::ostream& out) const override { - out << indent() << "}\n"; - out << "}\n"; - } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return indent(2) + "public enum " + s + styleStr(style) + "\n" + indent(2) + "{\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return indent(2) + "}" + + (isLast ? "\n" : "\n\n"); - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent(3) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override { - return indent(2) + std::string("public const uint ") + name + - " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); - } - }; - - // D printer - class TPrinterD final : public TPrinter { - private: - std::string commentBeg() const override { return "/+\n"; } - std::string commentBOL() const override { return " + "; } - std::string commentEnd(bool isLast) const override { return " +/\n"; } - - void printPrologue(std::ostream& out) const override { - out << "module spv;\n\n"; - } - - void printEpilogue(std::ostream& out) const override { - } - - std::string enumBeg(const std::string& s, enumStyle_t style) const override { - return "enum " + s + styleStr(style) + " : uint\n{\n"; - } - - std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override { - return std::string("}\n\n"); - } - - std::string enumFmt(const std::string& s, const valpair_t& v, - enumStyle_t style, bool isLast) const override { - return indent() + prependIfDigit("_", v.second) + " = " + fmtStyleVal(v.first, style) + ",\n"; - } - - std::string fmtConstInt(unsigned val, const std::string& name, - const char* fmt, bool isLast) const override { - return std::string("enum uint ") + name + - " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n"); - } - }; - } // namespace namespace spv { @@ -790,8 +672,6 @@ namespace spv { langInfo.push_back(std::make_pair(ELangJSON, "spirv.json")); langInfo.push_back(std::make_pair(ELangLua, "spirv.lua")); langInfo.push_back(std::make_pair(ELangPython, "spirv.py")); - langInfo.push_back(std::make_pair(ELangCSharp, "spirv.cs")); - langInfo.push_back(std::make_pair(ELangD, "spv.d")); for (const auto& lang : langInfo) { std::ofstream out(lang.second, std::ios::out); @@ -817,8 +697,6 @@ namespace spv { case ELangJSON: p = TPrinterPtr(new TPrinterJSON); break; case ELangLua: p = TPrinterPtr(new TPrinterLua); break; case ELangPython: p = TPrinterPtr(new TPrinterPython); break; - case ELangCSharp: p = TPrinterPtr(new TPrinterCSharp); break; - case ELangD: p = TPrinterPtr(new TPrinterD); break; case ELangAll: PrintAllHeaders(); break; default: std::cerr << "Unknown language." << std::endl; diff --git a/tools/buildHeaders/header.h b/tools/buildHeaders/header.h index 9c34b21..5a0952d 100644..100755 --- a/tools/buildHeaders/header.h +++ b/tools/buildHeaders/header.h @@ -1,19 +1,19 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. -// +// Copyright (c) 2014-2018 The Khronos Group Inc. +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), // to deal in the Materials without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Materials, and to permit persons to whom the // Materials are furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Materials. -// +// // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -41,8 +41,6 @@ namespace spv { ELangJSON, // JSON ELangLua, // Lua ELangPython, // Python - ELangCSharp, // CSharp - ELangD, // D ELangAll, // print headers in all languages to files }; diff --git a/tools/buildHeaders/jsonToSpirv.cpp b/tools/buildHeaders/jsonToSpirv.cpp index e6cab48..bb32566 100644..100755 --- a/tools/buildHeaders/jsonToSpirv.cpp +++ b/tools/buildHeaders/jsonToSpirv.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. +// Copyright (c) 2014-2018 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -119,7 +119,8 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co else if (quantifier == "?") return {OperandLiteralString, true}; else { - return {OperandOptionalLiteralStrings, false}; + assert(0 && "this case should not exist"); + return {OperandNone, false}; } } else if (operandKind == "PairLiteralIntegerIdRef") { // Used by OpSwitch in the grammar @@ -197,7 +198,7 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co } else if (operandKind == "FunctionControl") { type = OperandFunction; } else if (operandKind == "MemoryAccess") { - type = OperandMemoryOperands; + type = OperandMemoryAccess; } if (type == OperandNone) { @@ -229,21 +230,7 @@ unsigned int NumberStringToBit(const std::string& str) return bit; } -bool ExcludeInstruction(unsigned op, bool buildingHeaders) -{ - // Some instructions in the grammar don't need to be reflected - // in the specification. - - if (buildingHeaders) - return false; - - if (op >= 5699 /* OpVmeImageINTEL */ && op <= 5816 /* OpSubgroupAvcSicGetInterRawSadsINTEL */) - return true; - - return false; -} - -void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) +void jsonToSpirv(const std::string& jsonPath) { // only do this once. static bool initialized = false; @@ -301,12 +288,9 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) const Json::Value insts = root["instructions"]; for (const auto& inst : insts) { const unsigned int opcode = inst["opcode"].asUInt(); - if (ExcludeInstruction(opcode, buildingHeaders)) - continue; const std::string name = inst["opname"].asString(); EnumCaps caps = getCaps(inst); std::string version = inst["version"].asString(); - std::string lastVersion = inst["lastVersion"].asString(); Extensions exts = getExts(inst); OperandParameters operands; bool defResultId = false; @@ -322,7 +306,7 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) } InstructionDesc.emplace_back( std::move(EnumValue(opcode, name, - std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), + std::move(caps), std::move(version), std::move(exts), std::move(operands))), defTypeId, defResultId); } @@ -355,7 +339,6 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) continue; EnumCaps caps(getCaps(enumerant)); std::string version = enumerant["version"].asString(); - std::string lastVersion = enumerant["lastVersion"].asString(); Extensions exts(getExts(enumerant)); OperandParameters params; const Json::Value& paramsJson = enumerant["parameters"]; @@ -370,7 +353,7 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) } dest->emplace_back( value, enumerant["enumerant"].asString(), - std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), std::move(params)); + std::move(caps), std::move(version), std::move(exts), std::move(params)); } }; @@ -438,7 +421,7 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders) } else if (enumName == "Dim") { establishOperandClass(enumName, OperandDimensionality, &DimensionalityParams, operandEnum, category); } else if (enumName == "MemoryAccess") { - establishOperandClass(enumName, OperandMemoryOperands, &MemoryAccessParams, operandEnum, category); + establishOperandClass(enumName, OperandMemoryAccess, &MemoryAccessParams, operandEnum, category); } else if (enumName == "Scope") { establishOperandClass(enumName, OperandScope, &ScopeParams, operandEnum, category); } else if (enumName == "GroupOperation") { diff --git a/tools/buildHeaders/jsonToSpirv.h b/tools/buildHeaders/jsonToSpirv.h index beec01c..00a2f70 100644..100755 --- a/tools/buildHeaders/jsonToSpirv.h +++ b/tools/buildHeaders/jsonToSpirv.h @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. +// Copyright (c) 2014-2018 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -38,7 +38,7 @@ namespace spv { std::pair<bool, std::string> ReadFile(const std::string& path); // Fill in all the parameters -void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders); +void jsonToSpirv(const std::string& jsonPath); // For parameterizing operands. enum OperandClass { @@ -47,7 +47,6 @@ enum OperandClass { OperandVariableIds, OperandOptionalLiteral, OperandOptionalLiteralString, - OperandOptionalLiteralStrings, OperandVariableLiterals, OperandVariableIdLiteral, OperandVariableLiteralId, @@ -77,7 +76,7 @@ enum OperandClass { OperandLoop, OperandFunction, OperandMemorySemantics, - OperandMemoryOperands, + OperandMemoryAccess, OperandScope, OperandGroupOperation, OperandKernelEnqueueFlags, @@ -146,12 +145,6 @@ public: assert((where != end()) && "Could not find enum in the enum list"); return *where; } - // gets *all* entries for the value, including the first one - void gatherAliases(unsigned value, std::vector<EValue*>& aliases) { - std::for_each(begin(), end(), [&](EValue& e) { - if (value == e.value) - aliases.push_back(&e);}); - } // Returns the EValue with the given name. We assume uniqueness // by name. EValue& at(std::string name) { @@ -174,11 +167,9 @@ private: class EnumValue { public: EnumValue() : value(0), desc(nullptr) {} - EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps, - const std::string& the_firstVersion, const std::string& the_lastVersion, - Extensions&& the_extensions, OperandParameters&& the_operands) : - value(the_value), name(the_name), capabilities(std::move(the_caps)), - firstVersion(std::move(the_firstVersion)), lastVersion(std::move(the_lastVersion)), + EnumValue(unsigned int the_value, const std::string& the_name, EnumCaps&& the_caps, const std::string& the_version, + Extensions&& the_extensions, OperandParameters&& the_operands) : + value(the_value), name(the_name), capabilities(std::move(the_caps)), version(std::move(the_version)), extensions(std::move(the_extensions)), operands(std::move(the_operands)), desc(nullptr) { } // For ValueEnum, the value from the JSON file. @@ -187,8 +178,7 @@ public: unsigned value; std::string name; EnumCaps capabilities; - std::string firstVersion; - std::string lastVersion; + std::string version; // A feature only be enabled by certain extensions. // An empty list means the feature does not require an extension. // Normally, only Capability enums are enabled by extension. In turn, @@ -243,19 +233,10 @@ public: opDesc("TBD"), opClass(0), typePresent(has_type), - resultPresent(has_result), - alias(this) { } - InstructionValue(const InstructionValue& v) - { - *this = v; - alias = this; - } + resultPresent(has_result) {} bool hasResult() const { return resultPresent != 0; } bool hasType() const { return typePresent != 0; } - void setAlias(const InstructionValue& a) { alias = &a; } - const InstructionValue& getAlias() const { return *alias; } - bool isAlias() const { return alias != this; } const char* opDesc; int opClass; @@ -263,7 +244,6 @@ public: protected: int typePresent : 1; int resultPresent : 1; - const InstructionValue* alias; // correct only after discovering the aliases; otherwise points to this }; using InstructionValues = EnumValuesContainer<InstructionValue>; diff --git a/tools/buildHeaders/main.cpp b/tools/buildHeaders/main.cpp index 7e5f7f8..e146b39 100644..100755 --- a/tools/buildHeaders/main.cpp +++ b/tools/buildHeaders/main.cpp @@ -1,19 +1,19 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. -// +// Copyright (c) 2014-2018 The Khronos Group Inc. +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), // to deal in the Materials without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Materials, and to permit persons to whom the // Materials are furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Materials. -// +// // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS // STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -50,8 +50,6 @@ void Usage() " JSON - JSON format data\n" " Lua - Lua module\n" " Python - Python module (also accepts Py)\n" - " C# - C# module (also accepts CSharp)\n" - " D - D module\n" " -H print header in all supported languages to files in current directory\n" ); } @@ -92,10 +90,6 @@ bool ProcessArguments(int argc, char* argv[]) Language = spv::ELangLua; } else if (language == "python" || language == "py") { Language = spv::ELangPython; - } else if (language == "c#" || language == "csharp") { - Language = spv::ELangCSharp; - } else if (language == "d") { - Language = spv::ELangD; } else return false; @@ -119,7 +113,7 @@ int main(int argc, char* argv[]) return 1; } - spv::jsonToSpirv(jsonPath, (Options & EOptionPrintHeader) != 0); + spv::jsonToSpirv(jsonPath); if (Options & EOptionPrintHeader) spv::PrintHeader(Language, std::cout); |