Updated the includer interface to allow relative includes.
This plumbs both the current file path and the include depth back up to the includer. This allows the includer to properly support relative paths. This also replaces the string copy that was done during include with a zero-copy method of accomplishing the same thing. This prevents extra copies of entire files.
This commit is contained in:
parent
f2d8a5c53f
commit
a132af5b78
7 changed files with 220 additions and 54 deletions
|
|
@ -83,8 +83,10 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
namespace glslang {
|
||||
|
||||
TPpContext::TPpContext(TParseContext& pc, const TShader::Includer& inclr) :
|
||||
preamble(0), strings(0), parseContext(pc), includer(inclr), inComment(false)
|
||||
TPpContext::TPpContext(TParseContext& pc, const std::string& rootFileName, TShader::Includer& inclr) :
|
||||
preamble(0), strings(0), parseContext(pc), includer(inclr), inComment(false),
|
||||
rootFileName(rootFileName),
|
||||
currentSourceFile(rootFileName)
|
||||
{
|
||||
InitAtomTable();
|
||||
InitScanner();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue