Commit e2f954cd by jbauman@chromium.org

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
parent 06d7a755
#define MAJOR_VERSION 0 #define MAJOR_VERSION 0
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 628 #define BUILD_REVISION 629
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -884,6 +884,18 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig ...@@ -884,6 +884,18 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
return false; 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) if (!image->surface)
{ {
createSurface(image); createSurface(image);
......
...@@ -4751,16 +4751,6 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint ...@@ -4751,16 +4751,6 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
if (texture->isCompressed())
{
return error(GL_INVALID_OPERATION);
}
if (format != texture->getInternalFormat())
{
return error(GL_INVALID_OPERATION);
}
texture->subImage(target, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels); texture->subImage(target, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
} }
else else
......
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