Validate cube texsubimage based on current face
Apps can load cube faces in an arbitrary order, so validating texsubimage based on the format of only the first face won't work.
BUG=149
TEST=
Review URL: http://codereview.appspot.com/4445085
git-svn-id: https://angleproject.googlecode.com/svn/trunk@629 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index bf3fb99..f7931f2 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -884,6 +884,18 @@
return false;
}
+ if (IsCompressed(image->format))
+ {
+ error(GL_INVALID_OPERATION);
+ return false;
+ }
+
+ if (format != image->format)
+ {
+ error(GL_INVALID_OPERATION);
+ return false;
+ }
+
if (!image->surface)
{
createSurface(image);