Skip to content

Commit 15b46af

Browse files
authored
If a locator is not set for a DownstreamCompiler type, that doesn't *necessarily* mean that there isn't one, for example with the GENERIC_C_CPP option. This could also be fixed by say giving this type an empty locator, or special casing. The option chosen here, is to allow lookup even if there isn't a locator. Note that there is some special case handling, where a generic lookup, will prime all of the specific types. (shader-slang#1154)
1 parent a2d4d44 commit 15b46af

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

source/slang/slang-check.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,15 @@ namespace Slang
126126

127127
// Do we have a locator
128128
auto locator = m_downstreamCompilerLocators[int(type)];
129-
if (!locator)
129+
if (locator)
130130
{
131-
return nullptr;
132-
}
131+
m_downstreamCompilerSet->remove(SlangPassThrough(type));
133132

134-
m_downstreamCompilerSet->remove(SlangPassThrough(type));
133+
SinkSharedLibraryLoader loader(m_sharedLibraryLoader, sink);
134+
locator(m_downstreamCompilerPaths[int(type)], &loader, m_downstreamCompilerSet);
135135

136-
SinkSharedLibraryLoader loader(m_sharedLibraryLoader, sink);
137-
locator(m_downstreamCompilerPaths[int(type)], &loader, m_downstreamCompilerSet);
138-
139-
DownstreamCompilerUtil::updateDefaults(m_downstreamCompilerSet);
136+
DownstreamCompilerUtil::updateDefaults(m_downstreamCompilerSet);
137+
}
140138

141139
DownstreamCompiler* compiler = nullptr;
142140

0 commit comments

Comments
 (0)