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)