Texture::setImage methods now have an internal format parameter, if the internal format is unsized, a sized one is computed so that Texture classes always store sized internal formats.

TRAC #22972

Signed-off-by: Jamie Madill
Signed-off-by: Nicolas Capens
Author: Geoff Lang

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2314 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 6d0305a..5ab406f 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -6122,7 +6122,7 @@
                     return gl::error(GL_INVALID_OPERATION);
                 }
 
-                texture->setImage(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                texture->setImage(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
             }
             else
             {
@@ -6141,22 +6141,22 @@
                 switch (target)
                 {
                   case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
-                    texture->setImagePosX(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImagePosX(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
-                    texture->setImageNegX(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImageNegX(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
-                    texture->setImagePosY(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImagePosY(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
-                    texture->setImageNegY(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImageNegY(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
-                    texture->setImagePosZ(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImagePosZ(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
-                    texture->setImageNegZ(level, width, height, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImageNegZ(level, width, height, internalformat, format, type, context->getUnpackAlignment(), pixels);
                     break;
                   default: UNREACHABLE();
                 }
@@ -7597,14 +7597,14 @@
               case GL_TEXTURE_3D:
                 {
                     gl::Texture3D *texture = context->getTexture3D();
-                    texture->setImage(level, width, height, depth, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImage(level, width, height, depth, internalformat, format, type, context->getUnpackAlignment(), pixels);
                 }
                 break;
 
               case GL_TEXTURE_2D_ARRAY:
                 {
                     gl::Texture2DArray *texture = context->getTexture2DArray();
-                    texture->setImage(level, width, height, depth, format, type, context->getUnpackAlignment(), pixels);
+                    texture->setImage(level, width, height, depth, internalformat, format, type, context->getUnpackAlignment(), pixels);
                 }
                 break;