Add an option to support for GL_OES_EGL_image_external.
Comes with this extension is the new sampler type samplerExternalOES.
ANGLEBUG=175
TEST=compile the attached shader file
Review URL: http://codereview.appspot.com/4809076
git-svn-id: https://angleproject.googlecode.com/svn/trunk@728 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/Initialize.cpp b/src/compiler/Initialize.cpp
index 74a2de3..e0e1db9 100644
--- a/src/compiler/Initialize.cpp
+++ b/src/compiler/Initialize.cpp
@@ -363,6 +363,12 @@
s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);"));
s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);"));
+ if (resources.OES_EGL_image_external) {
+ s.append(TString("vec4 texture2D(samplerExternalOES sampler, vec2 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec4 coord);"));
+ }
+
return s;
}
@@ -388,6 +394,12 @@
s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);"));
s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord, float bias);"));
+ if (resources.OES_EGL_image_external) {
+ s.append(TString("vec4 texture2D(samplerExternalOES sampler, vec2 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec4 coord);"));
+ }
+
if (resources.OES_standard_derivatives) {
s.append(TString("float dFdx(float p);"));
s.append(TString("vec2 dFdx(vec2 p);"));
@@ -625,5 +637,7 @@
TExtensionBehavior& extBehavior)
{
if (resources.OES_standard_derivatives)
- extBehavior["GL_OES_standard_derivatives"] = EBhDisable;
+ extBehavior["GL_OES_standard_derivatives"] = EBhUndefined;
+ if (resources.OES_EGL_image_external)
+ extBehavior["GL_OES_EGL_image_external"] = EBhUndefined;
}