Extend ANGLE_request_extension with DisableExtension
ARB_texture_rectangle is the only currently supported disablable
extension. This allows us to use ARB_texture_rectangle in WebGL
implementations without exposing it to WebGL user shaders.
Bug: angleproject:3956
Bug: angleproject:3770
Change-Id: I80b10d2e9c9feebe545ce15195721487165ecc51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1838418
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES2.cpp b/src/libANGLE/validationES2.cpp
index 5bb0fcb..d1ffe9b 100644
--- a/src/libANGLE/validationES2.cpp
+++ b/src/libANGLE/validationES2.cpp
@@ -4976,6 +4976,23 @@
return true;
}
+bool ValidateDisableExtensionANGLE(Context *context, const GLchar *name)
+{
+ if (!context->getExtensions().requestExtension)
+ {
+ context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
+ return false;
+ }
+
+ if (!context->isExtensionDisablable(name))
+ {
+ context->validationError(GL_INVALID_OPERATION, kExtensionNotDisablable);
+ return false;
+ }
+
+ return true;
+}
+
bool ValidateActiveTexture(Context *context, GLenum texture)
{
if (context->getClientMajorVersion() < 2)