For all keywords already present, get correct when they could be identifiers, are reserved words, or are keywords, for all versions of ESSL and GLSL.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21282 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-04-25 16:44:03 +00:00
parent 09da79e190
commit c2ff7702be
13 changed files with 624 additions and 337 deletions

View file

@ -562,7 +562,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
// Original-style texture Functions existing in both stages.
// (Per-stage functions below.)
//
if (profile != EEsProfile || version == 100) {
if (profile == EEsProfile && version == 100 ||
profile == ECompatibilityProfile || version < FirstProfileVersion) {
s.append(TString("vec4 texture2D(sampler2D, vec2);"));
s.append(TString("vec4 texture2DProj(sampler2D, vec3);"));
@ -571,7 +572,8 @@ void TBuiltIns::initialize(int version, EProfile profile)
s.append(TString("vec4 textureCube(samplerCube, vec3);"));
}
if (profile != EEsProfile && version > 100) {
if (profile != EEsProfile &&
(profile == ECompatibilityProfile || version < FirstProfileVersion)) {
s.append(TString("vec4 texture1D(sampler1D, float);"));
s.append(TString("vec4 texture1DProj(sampler1D, vec2);"));
@ -585,12 +587,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
s.append(TString("vec4 shadow1DProj(sampler1DShadow, vec4);"));
s.append(TString("vec4 shadow2DProj(sampler2DShadow, vec4);"));
// ARB_texture_rectangle
s.append(TString("vec4 texture2DRect(sampler2DRect, vec2);"));
s.append(TString("vec4 texture2DRectProj(sampler2DRect, vec3);"));
s.append(TString("vec4 texture2DRectProj(sampler2DRect, vec4);"));
s.append(TString("vec4 shadow2DRect(sampler2DRectShadow, vec3);"));
s.append(TString("vec4 shadow2DRectProj(sampler2DRectShadow, vec4);"));
// TODO: functionality: non-ES legacy texuring for Lod, others?
}
s.append(TString("\n"));
@ -988,6 +985,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile)
continue;
if (dim == EsdRect && version < 140)
continue;
if (dim != Esd2D && ms)
continue;
if ((dim == Esd3D || dim == EsdRect) && arrayed)

File diff suppressed because it is too large Load diff

View file

@ -1619,24 +1619,24 @@ interpolation_qualifier
: SMOOTH {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "smooth"))
parseContext.recover();
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "smooth");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "smooth");
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "smooth");
parseContext.profileRequires($1.line, EEsProfile, 300, 0, "smooth");
$$.init($1.line);
$$.qualifier.smooth = true;
}
| FLAT {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "flat"))
parseContext.recover();
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "flat");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "flat");
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "flat");
parseContext.profileRequires($1.line, EEsProfile, 300, 0, "flat");
$$.init($1.line);
$$.qualifier.flat = true;
}
| NOPERSPECTIVE {
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "noperspective"))
parseContext.recover();
parseContext.requireProfile($$.line, static_cast<EProfileMask>(~EEsProfileMask), "noperspective");
parseContext.profileRequires($$.line, ENoProfile, 130, 0, "noperspective");
parseContext.requireProfile($1.line, static_cast<EProfileMask>(~EEsProfileMask), "noperspective");
parseContext.profileRequires($1.line, ENoProfile, 130, 0, "noperspective");
$$.init($1.line);
$$.qualifier.nopersp = true;
}
@ -1769,8 +1769,8 @@ storage_qualifier
$$.qualifier.storage = EvqOut;
}
| CENTROID {
parseContext.profileRequires($$.line, ENoProfile, 120, 0, "centroid");
parseContext.profileRequires($$.line, EEsProfile, 300, 0, "centroid");
parseContext.profileRequires($1.line, ENoProfile, 120, 0, "centroid");
parseContext.profileRequires($1.line, EEsProfile, 300, 0, "centroid");
if (parseContext.globalErrorCheck($1.line, parseContext.symbolTable.atGlobalLevel(), "centroid"))
parseContext.recover();
$$.init($1.line);
@ -1801,6 +1801,9 @@ storage_qualifier
$$.qualifier.storage = EvqUniform; // TODO: 4.0 functionality: implement BUFFER
}
| SHARED {
parseContext.requireProfile($1.line, static_cast<EProfileMask>(~EEsProfileMask), "shared");
parseContext.profileRequires($1.line, ECoreProfile, 430, 0, "shared");
parseContext.requireStage($1.line, EShLangComputeMask, "shared");
$$.init($1.line);
$$.qualifier.shared = true;
}