GL_EXT_debug_printf implementation

This commit is contained in:
Jeff Bolz 2019-05-31 13:06:01 -05:00
parent c6a4c6d3d8
commit 04d73731de
28 changed files with 4030 additions and 3794 deletions

19
glslang/MachineIndependent/preprocessor/Pp.cpp Executable file → Normal file
View file

@ -621,14 +621,25 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
{
const TSourceLoc directiveLoc = ppToken->loc;
bool startWithLocalSearch = true; // to additionally include the extra "" paths
int token = scanToken(ppToken);
int token;
// handle <header-name>-style #include
if (token == '<') {
// Find the first non-whitespace char after #include
int ch = getChar();
while (ch == ' ' || ch == '\t') {
ch = getChar();
}
if (ch == '<') {
// <header-name> style
startWithLocalSearch = false;
token = scanHeaderName(ppToken, '>');
} else if (ch == '"') {
// "header-name" style
token = scanHeaderName(ppToken, '"');
} else {
// unexpected, get the full token to generate the error
ungetChar();
token = scanToken(ppToken);
}
// otherwise ppToken already has the header name and it was "header-name" style
if (token != PpAtomConstString) {
parseContext.ppError(directiveLoc, "must be followed by a header name", "#include", "");