From 61e9154cb797cffe19cfbf3205b4a5a614e8b552 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 May 2021 15:57:11 -0400 Subject: Glslang as DownstreamCompiler (#1846) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP Fxc as downstream compiler. * First pass FXC downstream compiler working. * GCC compile fix. * Fix FXC parsing issue. * Special case filesystem access. * Use StringUtil getSlice. * Fix isses with not emitting source for FXC. * WIP on DXC. * Small fixes for DXBC handling. * Removed DXC from ParseDiagnosticUtil (can use generic) Try to improve output for notes from DXC. * FIrst pass of Glslang as DownstreamCompiler * Fix some problems with parsing for glslang replacement. * Add slang-glslang-compiler.cpp/.h * Fix downstream for spir-v output. * dissassemble -> disassemble * Fix typo and improve some naming/comments. * Remove getSharedLibrary from DownstreamCompiler * Removed some no longer used diagnostics. --- source/slang/slang-check.cpp | 56 -------------------------------------------- 1 file changed, 56 deletions(-) (limited to 'source/slang/slang-check.cpp') diff --git a/source/slang/slang-check.cpp b/source/slang/slang-check.cpp index a5701aa90..55306a0da 100644 --- a/source/slang/slang-check.cpp +++ b/source/slang/slang-check.cpp @@ -62,18 +62,6 @@ namespace Slang } // anonymous - static FunctionInfo _getFunctionInfo(Session::SharedLibraryFuncType funcType) - { - typedef Session::SharedLibraryFuncType FuncType; - - switch (funcType) - { - case FuncType::Glslang_Compile_1_0: return { "glslang_compile", PassThroughMode::Glslang} ; - case FuncType::Glslang_Compile_1_1: return { "glslang_compile_1_1", PassThroughMode::Glslang} ; - case FuncType::Dxc_DxcCreateInstance: return { "DxcCreateInstance", PassThroughMode::Dxc }; - default: return { nullptr, PassThroughMode::None }; - } - } void Session::_setSharedLibraryLoader(ISlangSharedLibraryLoader* loader) { @@ -88,9 +76,6 @@ namespace Slang m_downstreamCompilers[i].setNull(); } - // Clear all of the functions - ::memset(m_sharedLibraryFunctions, 0, sizeof(m_sharedLibraryFunctions)); - // Set the loader m_sharedLibraryLoader = loader; } @@ -179,47 +164,6 @@ namespace Slang return compiler; } - SlangFuncPtr Session::getSharedLibraryFunc(SharedLibraryFuncType type, DiagnosticSink* sink) - { - if (m_sharedLibraryFunctions[int(type)]) - { - return m_sharedLibraryFunctions[int(type)]; - } - // do we have the library - FunctionInfo info = _getFunctionInfo(type); - if (info.name == nullptr) - { - return nullptr; - } - // Try loading the library - DownstreamCompiler* compiler = getOrLoadDownstreamCompiler(info.compilerType, sink); - if (!compiler) - { - return nullptr; - } - ISlangSharedLibrary* sharedLibrary = compiler->getSharedLibrary(); - if (!sharedLibrary) - { - return nullptr; - } - - // Okay now access the func - SlangFuncPtr func = sharedLibrary->findFuncByName(info.name); - if (!func) - { - if (sink) - { - UnownedStringSlice compilerName = TypeTextUtil::getPassThroughName(SlangPassThrough(info.compilerType)); - sink->diagnose(SourceLoc(), Diagnostics::failedToFindFunctionForCompiler, info.name, compilerName); - } - return nullptr; - } - - // Store in the function cache - m_sharedLibraryFunctions[int(type)] = func; - return func; - } - void checkTranslationUnit( TranslationUnitRequest* translationUnit) { -- cgit v1.2.3