{\r
gl_FragDepth = f13; // ERROR\r
gl_FragDepthEXT = f13;\r
-}
\ No newline at end of file
+}\r
+\r
+#extension GL_OES_EGL_image_external : enable\r
+\r
+uniform samplerExternalOES sExt;\r
+\r
+void foo245()\r
+{\r
+ texture2D(sExt, vec2(0.2));\r
+ texture2DProj(sExt, vec3(f13));\r
+ texture2DProj(sExt, v[2]);\r
+}\r
+\r
+precision mediump samplerExternalOES;\r
+uniform samplerExternalOES mediumExt;\r
+uniform highp samplerExternalOES highExt;\r
+\r
+void foo246()\r
+{\r
+ texture2D(mediumExt, vec2(0.2));\r
+ texture2DProj(highExt, v[2]);\r
+ texture3D(sExt, vec3(f13)); // ERROR\r
+ texture2DProjLod(sExt, vec3(f13), f13); // ERROR\r
+}\r
+\r
+#extension GL_OES_EGL_image_external : disable\r
+\r
+uniform samplerExternalOES badExt; // syntax ERROR\r
ERROR: 0:103: 'gl_FragDepth' : undeclared identifier \r
ERROR: 0:104: 'gl_FragDepthEXT' : required extension not requested: GL_EXT_frag_depth\r
ERROR: 0:111: 'gl_FragDepth' : undeclared identifier \r
-ERROR: 43 compilation errors. No code generated.\r
+ERROR: 0:134: 'texture3D' : no matching overloaded function found \r
+ERROR: 0:135: 'texture2DProjLod' : no matching overloaded function found \r
+ERROR: 0:140: '' : syntax error\r
+ERROR: 46 compilation errors. No code generated.\r
\r
ERROR: node is still EOpNull!\r
0:3 Sequence\r
0:112 move second child to first child (highp float)\r
0:112 'gl_FragDepthEXT' (gl_FragDepth highp float)\r
0:112 'f13' (invariant mediump float)\r
+0:119 Function Definition: foo245( (void)\r
+0:119 Function Parameters: \r
+0:121 Sequence\r
+0:121 Function Call: texture2D(sE21;vf2; (lowp 4-component vector of float)\r
+0:121 'sExt' (uniform lowp samplerExternalOES)\r
+0:121 Constant:\r
+0:121 0.200000\r
+0:121 0.200000\r
+0:122 Function Call: texture2DProj(sE21;vf3; (lowp 4-component vector of float)\r
+0:122 'sExt' (uniform lowp samplerExternalOES)\r
+0:122 Construct vec3 (3-component vector of float)\r
+0:122 'f13' (invariant mediump float)\r
+0:123 Function Call: texture2DProj(sE21;vf4; (lowp 4-component vector of float)\r
+0:123 'sExt' (uniform lowp samplerExternalOES)\r
+0:123 direct index (smooth mediump 4-component vector of float)\r
+0:123 'v' (smooth in 3-element array of mediump 4-component vector of float)\r
+0:123 Constant:\r
+0:123 2 (const int)\r
+0:130 Function Definition: foo246( (void)\r
+0:130 Function Parameters: \r
+0:132 Sequence\r
+0:132 Function Call: texture2D(sE21;vf2; (mediump 4-component vector of float)\r
+0:132 'mediumExt' (uniform mediump samplerExternalOES)\r
+0:132 Constant:\r
+0:132 0.200000\r
+0:132 0.200000\r
+0:133 Function Call: texture2DProj(sE21;vf4; (highp 4-component vector of float)\r
+0:133 'highExt' (uniform highp samplerExternalOES)\r
+0:133 direct index (smooth mediump 4-component vector of float)\r
+0:133 'v' (smooth in 3-element array of mediump 4-component vector of float)\r
+0:133 Constant:\r
+0:133 2 (const int)\r
+0:134 Constant:\r
+0:134 0.000000\r
+0:135 Constant:\r
+0:135 0.000000\r
0:? Linker Objects\r
0:? 'a' (3-element array of mediump int)\r
0:? 'uint' (mediump int)\r
0:? 'vary2D' (smooth in lowp sampler2D)\r
0:? 's3D' (uniform mediump sampler3D)\r
0:? 's3D2' (uniform highp sampler3D)\r
+0:? 'sExt' (uniform lowp samplerExternalOES)\r
+0:? 'mediumExt' (uniform mediump samplerExternalOES)\r
+0:? 'highExt' (uniform highp samplerExternalOES)\r
\r
bool shadow : 1;
bool ms : 1;
bool image : 1;
+ bool external : 1; // GL_OES_EGL_image_external
void clear()
{
shadow = false;
ms = false;
image = false;
+ external = false;
}
void set(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false)
shadow = s;
ms = m;
image = false;
+ external = false;
}
void setImage(TBasicType t, TSamplerDim d, bool a = false, bool s = false, bool m = false)
shadow = s;
ms = m;
image = true;
+ external = false;
}
bool operator==(const TSampler& right) const
arrayed == right.arrayed &&
shadow == right.shadow &&
ms == right.ms &&
- image == right.image;
+ image == right.image &&
+ external == right.external;
}
TString getString() const
s.append("image");
else
s.append("sampler");
+ if (external) {
+ s.append("ExternalOES");
+ return s;
+ }
switch (dim) {
case Esd1D: s.append("1D"); break;
case Esd2D: s.append("2D"); break;
"\n");
}
+ if (profile == EEsProfile) {
+ // GL_OES_EGL_image_external, caught by keyword check
+ commonBuiltins.append(
+ "vec4 texture2D(samplerExternalOES, vec2 coord);"
+ "vec4 texture2DProj(samplerExternalOES, vec3);"
+ "vec4 texture2DProj(samplerExternalOES, vec4);"
+ "\n");
+ }
+
//
// Noise functions.
//
defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow;
sampler.set(EbtFloat, EsdCube);
defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow;
+ sampler.set(EbtFloat, Esd2D);
+ sampler.external = true;
+ defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow;
switch (language) {
case EShLangFragment:
// correlates with the declaration of defaultSamplerPrecision[]
int TParseContext::computeSamplerTypeIndex(TSampler& sampler)
{
- int arrayIndex = sampler.arrayed ? 1 : 0;
- int shadowIndex = sampler.shadow ? 1 : 0;
+ int arrayIndex = sampler.arrayed ? 1 : 0;
+ int shadowIndex = sampler.shadow ? 1 : 0;
+ int externalIndex = sampler.external ? 1 : 0;
- return EsdNumDims * (EbtNumTypes * (2 * arrayIndex + shadowIndex) + sampler.type) + sampler.dim;
+ return EsdNumDims * (EbtNumTypes * (2 * (2 * arrayIndex + shadowIndex) + externalIndex) + sampler.type) + sampler.dim;
}
TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType)
int numErrors; // number of compile-time errors encountered
bool parsingBuiltins; // true if parsing built-in symbols/functions
TMap<TString, TExtensionBehavior> extensionBehavior; // for each extension string, what its current behavior is set to
- static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2)); // see computeSamplerTypeIndex()
+ static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2)); // see computeSamplerTypeIndex()
TPrecisionQualifier defaultSamplerPrecision[maxSamplerIndex];
bool afterEOF;
TQualifier globalBufferDefaults;
(*KeywordMap)["sampler2DRect"] = SAMPLER2DRECT;
(*KeywordMap)["sampler2DRectShadow"] = SAMPLER2DRECTSHADOW;
(*KeywordMap)["sampler1DArray"] = SAMPLER1DARRAY;
+ (*KeywordMap)["samplerExternalOES"] = SAMPLEREXTERNALOES; // GL_OES_EGL_image_external
(*KeywordMap)["noperspective"] = NOPERSPECTIVE;
(*KeywordMap)["smooth"] = SMOOTH;
(*KeywordMap)["flat"] = FLAT;
return identifierOrType();
return keyword;
+ case SAMPLEREXTERNALOES:
+ afterType = true;
+ if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionsTurnedOn(1, &GL_OES_EGL_image_external))
+ return keyword;
+ return identifierOrType();
+
case NOPERSPECTIVE:
return es30ReservedFromGLSL(130);
mangledName += "A";
if (sampler.shadow)
mangledName += "S";
+ if (sampler.external)
+ mangledName += "E";
switch (sampler.dim) {
case Esd1D: mangledName += "1"; break;
case Esd2D: mangledName += "2"; break;
extensionBehavior[GL_OES_texture_3D] = EBhDisable;
extensionBehavior[GL_OES_standard_derivatives] = EBhDisable;
extensionBehavior[GL_EXT_frag_depth] = EBhDisable;
+ extensionBehavior[GL_OES_EGL_image_external] = EBhDisable;
extensionBehavior[GL_ARB_texture_rectangle] = EBhDisable;
extensionBehavior[GL_3DL_array_objects] = EBhDisable;
"#define GL_ES 1\n"
"#define GL_OES_texture_3D 1\n"
"#define GL_OES_standard_derivatives 1\n"
- "#define GL_EXT_frag_depth 1\n";
+ "#define GL_EXT_frag_depth 1\n"
+ "#define GL_OES_EGL_image_external 1\n";
} else {
return
"#define GL_FRAGMENT_PRECISION_HIGH 1\n"
const char* const GL_OES_texture_3D = "GL_OES_texture_3D";
const char* const GL_OES_standard_derivatives = "GL_OES_standard_derivatives";
const char* const GL_EXT_frag_depth = "GL_EXT_frag_depth";
+const char* const GL_OES_EGL_image_external = "GL_OES_EGL_image_external";
const char* const GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle";
const char* const GL_3DL_array_objects = "GL_3DL_array_objects";
%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY\r
%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS\r
%token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY\r
+%token <lex> SAMPLEREXTERNALOES\r
\r
%token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D\r
%token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D\r
$$.basicType = EbtSampler;\r
$$.sampler.setImage(EbtUint, Esd2D, true, false, true);\r
}\r
+ | SAMPLEREXTERNALOES { // GL_OES_EGL_image_external\r
+ $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());\r
+ $$.basicType = EbtSampler;\r
+ $$.sampler.set(EbtFloat, Esd2D);\r
+ $$.sampler.external = true;\r
+ }\r
| struct_specifier {\r
$$ = $1;\r
$$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;\r