Add the GL_ES macro for ES personalities, along with a general mechanism for adding preambles in front of shaders without effecting line numbers, etc.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21122 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-04-11 16:31:09 +00:00
parent 63eed3867a
commit b51f62c573
8 changed files with 60 additions and 23 deletions

View file

@ -168,23 +168,26 @@ int FreeScanner(void)
*/
static int str_getch(StringInputSrc *in)
{
for(;;){
if (*in->p){
for(;;) {
if (*in->p) {
if (*in->p == '\n') {
in->base.line++;
IncLineNumber();
}
return *in->p++;
}
if(++(cpp->PaWhichStr) < cpp->PaArgc){
if (cpp->PaWhichStr < 0) {
// we only parsed the built-in pre-amble; start with clean slate for user code
cpp->notAVersionToken = 0;
}
if (++(cpp->PaWhichStr) < cpp->PaArgc) {
free(in);
SetStringNumber(cpp->PaWhichStr);
SetLineNumber(1);
ScanFromString(cpp->PaArgv[cpp->PaWhichStr]);
in=(StringInputSrc*)cpp->currentInput;
continue;
}
else{
} else {
cpp->currentInput = in->base.prev;
cpp->PaWhichStr=0;
free(in);