Add texture rectangle extension.
This is needed to support binding IOSurfaces to textures on OSX. This
commit adds support in the API and tests, but didn't need to implement
compiler changes as it already supported ARB_texture_rectangle.
Implementation of CHROMIUM_opy_texture for rectangle texture and the
spec are left for follow-up commits.
Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867
Reviewed-on: https://chromium-review.googlesource.com/559106
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES3.cpp b/src/libANGLE/validationES3.cpp
index 6cc1827..3a97b17 100644
--- a/src/libANGLE/validationES3.cpp
+++ b/src/libANGLE/validationES3.cpp
@@ -199,6 +199,22 @@
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ ASSERT(level == 0);
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ if (isCompressed)
+ {
+ context->handleError(InvalidEnum()
+ << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+ break;
+
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
@@ -851,6 +867,17 @@
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ {
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize || levels != 1)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ }
+ break;
+
case GL_TEXTURE_CUBE_MAP:
{
if (width != height)
@@ -922,6 +949,12 @@
return false;
}
+ if (formatInfo.compressed && target == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ context->handleError(InvalidEnum() << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+
return true;
}