@@ -41,6 +41,7 @@ static tcpp::IInputStream* getInputStreamInclude(
41
41
const system::ISystem* _fs,
42
42
uint32_t _maxInclCnt,
43
43
const char * _requesting_source,
44
+ const char * _requested_source,
44
45
bool _type // true for #include "string"; false for #include <string>
45
46
)
46
47
{
@@ -57,15 +58,15 @@ static tcpp::IInputStream* getInputStreamInclude(
57
58
// or path relative to executable's working directory (""-type).
58
59
relDir = std::filesystem::path (_requesting_source).parent_path ();
59
60
}
60
- std::filesystem::path name = _type ? (relDir / _requesting_source ) : (_requesting_source );
61
+ std::filesystem::path name = _type ? (relDir / _requested_source ) : (_requested_source );
61
62
62
63
if (std::filesystem::exists (name) && !reqBuiltin)
63
64
name = std::filesystem::absolute (name);
64
65
65
66
if (_type)
66
- res_str = _inclFinder->getIncludeRelative (relDir, _requesting_source );
67
+ res_str = _inclFinder->getIncludeRelative (relDir, _requested_source );
67
68
else // shaderc_include_type_standard
68
- res_str = _inclFinder->getIncludeStandard (relDir, _requesting_source );
69
+ res_str = _inclFinder->getIncludeStandard (relDir, _requested_source );
69
70
70
71
if (!res_str.size ()) {
71
72
return new tcpp::StringInputStream (" #error File not found" );
@@ -172,7 +173,7 @@ std::string CHLSLCompiler::preprocessShader(std::string&& code, IShader::E_SHADE
172
173
[&](auto path, auto isSystemPath) {
173
174
return getInputStreamInclude (
174
175
preprocessOptions.includeFinder , m_system.get (), preprocessOptions.maxSelfInclusionCount + 1u ,
175
- path.c_str (), !isSystemPath
176
+ preprocessOptions. sourceIdentifier . data (), path.c_str (), !isSystemPath
176
177
);
177
178
}
178
179
);
0 commit comments