mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-07 12:51:33 +00:00
Handle C comments starting on a pre-processor line in GLSL patching
This commit is contained in:
1 parent
605f7c9a0e
commit
caaef06ba7
1 file changed
+11
@@ -429,7 +429,18 @@ GLuint MakeSeparableShaderProgram(WrappedOpenGL &gl, GLenum type, vector<string>
|
||||
|
||||
// keep going until the next newline
|
||||
while(it < len && !isnewline(src[it]))
|
||||
{
|
||||
// if we encounter a C-style comment in the middle of a #define
|
||||
// we can't consume it because then we'd miss the start of it.
|
||||
// Instead we break out (although we're not technically at the
|
||||
// end of the pre-processor line) and let it be consumed next.
|
||||
// Note that we can discount C++-style comments because they
|
||||
// want to consume to the end of the line too.
|
||||
if(it + 1 < len && src[it] == '/' && src[it + 1] == '*')
|
||||
break;
|
||||
|
||||
++it;
|
||||
}
|
||||
|
||||
// skip more things
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user