Built-in symbol tables now lazily evaluated, and driven by per version, per profile input. Got all ES 100 and ES 300 built-in symbols correct.
This includes - doing prescan of shader to know version/profile before parsing it - putting precision qualifiers on built-in ES symbols - getting most built-in state correct for core/compatibility/missing profile - adding gl_VertexID and gl_InstanceID, among other ES 300 built-in symbols - adding the ES 300 gl_Max/Min constants - accepting shaders that contain nothing but whitespace without generating an error git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20627 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
fb5f7eadfa
commit
bd0747d6f0
16 changed files with 843 additions and 491 deletions
|
|
@ -479,14 +479,14 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon
|
|||
return 1;
|
||||
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (!argv[i]) {
|
||||
if (! argv[i]) {
|
||||
parseContextLocal.error(0, "Null shader source string", "", "");
|
||||
parseContextLocal.recover();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!strLen) {
|
||||
if (! strLen) {
|
||||
argv0len = (int) strlen(argv[0]);
|
||||
strLen = &argv0len;
|
||||
}
|
||||
|
|
@ -499,7 +499,16 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon
|
|||
cpp->notAVersionToken = 0;
|
||||
yylineno = 1;
|
||||
|
||||
if (*cpp->PaStrLen >= 0) {
|
||||
// TODO: CPP: a shader containing nothing but white space and comments is valid, even though it has no parse tokens
|
||||
int len = 0;
|
||||
while (argv[0][len] == ' ' ||
|
||||
argv[0][len] == '\t' ||
|
||||
argv[0][len] == '\n' ||
|
||||
argv[0][len] == '\r')
|
||||
if (++len >= strLen[0])
|
||||
return 0;
|
||||
|
||||
if (*cpp->PaStrLen > 0) {
|
||||
int ret;
|
||||
#ifdef _WIN32
|
||||
ret = yyparse(parseContextLocal);
|
||||
|
|
@ -510,8 +519,7 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon
|
|||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -838,14 +846,18 @@ void ResetTString(void)
|
|||
|
||||
void SetVersion(int version)
|
||||
{
|
||||
TParseContext& pc = *((TParseContext *)cpp->pC);
|
||||
pc.setVersion(version);
|
||||
// called by the CPP, but this functionality is currently
|
||||
// taken over by ScanVersion() before parsing starts
|
||||
|
||||
// CPP should still report errors in semantics
|
||||
}
|
||||
|
||||
void SetProfile(EProfile profile)
|
||||
{
|
||||
TParseContext& pc = *((TParseContext *)cpp->pC);
|
||||
pc.setProfile(profile);
|
||||
// called by the CPP, but this functionality is currently
|
||||
// taken over by ScanVersion() before parsing starts
|
||||
|
||||
// CPP should still report errors in semantics
|
||||
}
|
||||
|
||||
TBehavior GetBehavior(const char* behavior)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue