Split WebGL compatibility into two extensions.
The mechanism for requesting extensions is now a separate extension.
Added a way to query the extensions that support enabling.
BUG=angleproject:1523
Change-Id: I2efaa9f6d67b12ecae325f455404e34ba04d0e7c
Reviewed-on: https://chromium-review.googlesource.com/414529
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 6ac8357..f814d17 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -3521,20 +3521,20 @@
return true;
}
-bool ValidateEnableExtensionANGLE(ValidationContext *context, const GLchar *name)
+bool ValidateRequestExtensionANGLE(ValidationContext *context, const GLchar *name)
{
- if (!context->getExtensions().webglCompatibility)
+ if (!context->getExtensions().requestExtension)
{
context->handleError(
- Error(GL_INVALID_OPERATION, "GL_ANGLE_webgl_compatibility is not available."));
+ Error(GL_INVALID_OPERATION, "GL_ANGLE_request_extension is not available."));
return false;
}
const ExtensionInfoMap &extensionInfos = GetExtensionInfoMap();
auto extension = extensionInfos.find(name);
- if (extension == extensionInfos.end() || !extension->second.Enableable)
+ if (extension == extensionInfos.end() || !extension->second.Requestable)
{
- context->handleError(Error(GL_INVALID_OPERATION, "Extension %s is not enableable.", name));
+ context->handleError(Error(GL_INVALID_OPERATION, "Extension %s is not requestable.", name));
return false;
}
@@ -3838,4 +3838,31 @@
return true;
}
+bool ValidateGetString(Context *context, GLenum name)
+{
+ switch (name)
+ {
+ case GL_VENDOR:
+ case GL_RENDERER:
+ case GL_VERSION:
+ case GL_SHADING_LANGUAGE_VERSION:
+ case GL_EXTENSIONS:
+ break;
+
+ case GL_REQUESTABLE_EXTENSIONS_ANGLE:
+ if (!context->getExtensions().requestExtension)
+ {
+ context->handleError(Error(GL_INVALID_ENUM, "Invalid name."));
+ return false;
+ }
+ break;
+
+ default:
+ context->handleError(Error(GL_INVALID_ENUM, "Invalid name."));
+ return false;
+ }
+
+ return true;
+}
+
} // namespace gl