Commit f5450910 by zmo@google.com

Fix extension behavior in shader validation.

If an extension is not specified, it is disabled by default, thus a shader should fail compiling if features from that extension are used. ANGLEBUG=204 TEST=webgl conformance/extensions/oes-standard-derivatives.html Review URL: http://codereview.appspot.com/4974071 git-svn-id: https://angleproject.googlecode.com/svn/trunk@745 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 83b61bc6
......@@ -97,7 +97,17 @@ int main(int argc, char* argv[])
failCode = EFailUsage;
}
break;
case 'a': resources.OES_EGL_image_external = 1; break;
case 'x':
if (argv[0][2] == '=') {
switch (argv[0][3]) {
case 'i': resources.OES_EGL_image_external = 1; break;
case 'd': resources.OES_standard_derivatives = 1; break;
default: failCode = EFailUsage;
}
} else {
failCode = EFailUsage;
}
break;
default: failCode = EFailUsage;
}
} else {
......@@ -178,7 +188,7 @@ int main(int argc, char* argv[])
//
void usage()
{
printf("Usage: translate [-i -m -o -u -l -e -b=e -b=g -b=h -a] file1 file2 ...\n"
printf("Usage: translate [-i -m -o -u -l -e -b=e -b=g -b=h -x=i -x=d] file1 file2 ...\n"
"Where: filename : filename ending in .frag or .vert\n"
" -i : print intermediate tree\n"
" -m : map long variable names\n"
......@@ -189,7 +199,8 @@ void usage()
" -b=e : output GLSL ES code (this is by default)\n"
" -b=g : output GLSL code\n"
" -b=h : output HLSL code\n"
" -a : enable GL_OES_EGL_image_external\n");
" -x=i : enable GL_OES_EGL_image_external\n"
" -x=d : enable GL_OES_EGL_standard_derivatives\n");
}
//
......
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 744
#define BUILD_REVISION 745
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -929,7 +929,8 @@ bool TParseContext::extensionErrorCheck(int line, const TString& extension)
error(line, "extension", extension.c_str(), "is not supported");
return true;
}
if (iter->second == EBhDisable) {
// In GLSL ES, an extension's default behavior is "disable".
if (iter->second == EBhDisable || iter->second == EBhUndefined) {
error(line, "extension", extension.c_str(), "is disabled");
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment