diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-18 19:13:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-18 19:13:02 -0500 |
| commit | 45d1a680634c59d1081ed09dddaa444695296492 (patch) | |
| tree | af803579f32d1592a297d70e41f848184dea93ea /source/slang/slang-compiler.cpp | |
| parent | 8ee39e08c48a315163fe1850dbb12ca292020d4d (diff) | |
Added support for Targets to TypeTextUtil. (#1226)
* Added support for Targets to TypeTextUtil.
* Made Function names 'get' and 'find' instead of 'as' in TypeTextUtil.
Diffstat (limited to 'source/slang/slang-compiler.cpp')
| -rw-r--r-- | source/slang/slang-compiler.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 65c48d2f2..94cf7f73c 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -75,65 +75,6 @@ namespace Slang { - -// NOTE! These must be in the same order as the SlangCompileTarget enum -#define SLANG_CODE_GEN_TARGETS(x) \ - x("unknown", Unknown) \ - x("none", None) \ - x("glsl", GLSL) \ - x("glsl-vulkan", GLSL_Vulkan) \ - x("glsl-vulkan-one-desc", GLSL_Vulkan_OneDesc) \ - x("hlsl", HLSL) \ - x("spirv", SPIRV) \ - x("spirv-asm,spirv-assembly", SPIRVAssembly) \ - x("dxbc", DXBytecode) \ - x("dxbc-asm,dxbc-assembly", DXBytecodeAssembly) \ - x("dxil", DXIL) \ - x("dxil-asm,dxil-assembly", DXILAssembly) \ - x("c", CSource) \ - x("cpp", CPPSource) \ - x("exe,executable", Executable) \ - x("sharedlib,sharedlibrary,dll", SharedLibrary) \ - x("callable,host-callable", HostCallable) \ - x("cu,cuda", CUDASource) \ - x("ptx", PTX) - -#define SLANG_CODE_GEN_INFO(names, e) \ - { CodeGenTarget::e, UnownedStringSlice::fromLiteral(names) }, - - struct CodeGenTargetInfo - { - CodeGenTarget target; - UnownedStringSlice names; - }; - - static const CodeGenTargetInfo s_codeGenTargetInfos[] = - { - SLANG_CODE_GEN_TARGETS(SLANG_CODE_GEN_INFO) - }; - - CodeGenTarget calcCodeGenTargetFromName(const UnownedStringSlice& name) - { - for (int i = 0; i < SLANG_COUNT_OF(s_codeGenTargetInfos); ++i) - { - const auto& info = s_codeGenTargetInfos[i]; - - // If this assert fails, then the SLANG_CODE_GEN_TARGETS macro has the wrong order - SLANG_ASSERT(i == int(info.target)); - - if (StringUtil::indexOfInSplit(info.names, ',', name) >= 0) - { - return info.target; - } - } - return CodeGenTarget::Unknown; - } - UnownedStringSlice getCodeGenTargetName(CodeGenTarget target) - { - // Return the first name - return StringUtil::getAtInSplit(s_codeGenTargetInfos[int(target)].names, ',', 0); - } - SlangResult CompileResult::getSharedLibrary(ComPtr<ISlangSharedLibrary>& outSharedLibrary) { if (downstreamResult) |
