mesa/st: enable carry/borrow lowering pass
[mesa.git] / src / mesa / main / textureview.c
index 5c08b1abfb469cf138a3f49c79c70a0c6ea79fca..77a3b782b5af036a6220e351437747311a388cd7 100644 (file)
@@ -169,7 +169,7 @@ static const struct internal_format_class_info s3tc_compatible_internal_formats[
 static GLenum
 lookup_view_class(struct gl_context *ctx, GLenum internalformat)
 {
-   uint i;
+   GLuint i;
 
    for (i = 0; i < ARRAY_SIZE(compatible_internal_formats); i++) {
       if (compatible_internal_formats[i].internal_format == internalformat)
@@ -196,7 +196,7 @@ initialize_texture_fields(struct gl_context *ctx,
                           struct gl_texture_object *texObj,
                           GLint levels,
                           GLsizei width, GLsizei height, GLsizei depth,
-                          GLenum internalFormat, gl_format texFormat)
+                          GLenum internalFormat, mesa_format texFormat)
 {
    const GLuint numFaces = _mesa_num_tex_faces(target);
    GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
@@ -208,8 +208,13 @@ initialize_texture_fields(struct gl_context *ctx,
    /* Set up all the texture object's gl_texture_images */
    for (level = 0; level < levels; level++) {
       for (face = 0; face < numFaces; face++) {
-         struct gl_texture_image *texImage =
-                 _mesa_get_tex_image(ctx, texObj, face, level);
+         struct gl_texture_image *texImage;
+         GLenum faceTarget = target;
+
+         if (target == GL_TEXTURE_CUBE_MAP)
+            faceTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face;
+
+         texImage = _mesa_get_tex_image(ctx, texObj, faceTarget, level);
 
          if (!texImage) {
             _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexStorage");
@@ -425,7 +430,7 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture,
    GLuint newViewMinLevel, newViewMinLayer;
    GLuint newViewNumLevels, newViewNumLayers;
    GLsizei width, height, depth;
-   gl_format texFormat;
+   mesa_format texFormat;
    GLboolean sizeOK, dimensionsOK;
    GLenum faceTarget;