i965: Silence 'comparison is always true' warning
[mesa.git] / src / mesa / drivers / dri / i915 / intel_tex_image.c
index 68687df03f72448d161d9b58475716a667a70c45..57674b9b5cf65c17dcd7db606a821e44959a0b89 100644 (file)
@@ -171,6 +171,7 @@ try_pbo_upload(struct gl_context *ctx,
                            0, 0, false,
                            image->Width, image->Height, GL_COPY)) {
       DBG("%s: blit failed\n", __FUNCTION__);
+      intel_miptree_release(&pbo_mt);
       return false;
    }
 
@@ -187,22 +188,10 @@ intelTexImage(struct gl_context * ctx,
               GLenum format, GLenum type, const void *pixels,
               const struct gl_pixelstore_attrib *unpack)
 {
-   bool ok;
-
    DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
        _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
        texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
 
-   ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
-                                       0, 0, 0, /*x,y,z offsets*/
-                                       texImage->Width,
-                                       texImage->Height,
-                                       texImage->Depth,
-                                       format, type, pixels, unpack,
-                                       true /*for_glTexImage*/);
-   if (ok)
-      return;
-
    /* Attempt to use the blitter for PBO image uploads.
     */
    if (dims <= 2 &&
@@ -230,7 +219,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
                               struct intel_region *region,
                               GLenum target,
                               GLenum internalFormat,
-                              gl_format format,
+                              mesa_format format,
                                uint32_t offset,
                                GLuint width,
                                GLuint height,
@@ -298,7 +287,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    struct gl_texture_object *texObj;
    struct gl_texture_image *texImage;
    int level = 0, internalFormat = 0;
-   gl_format texFormat = MESA_FORMAT_NONE;
+   mesa_format texFormat = MESA_FORMAT_NONE;
 
    texObj = _mesa_get_current_tex_object(ctx, target);
    intelObj = intel_texture_object(texObj);
@@ -320,15 +309,15 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
    if (rb->mt->cpp == 4) {
       if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
          internalFormat = GL_RGB;
-         texFormat = MESA_FORMAT_XRGB8888;
+         texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
       }
       else {
          internalFormat = GL_RGBA;
-         texFormat = MESA_FORMAT_ARGB8888;
+         texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
       }
    } else if (rb->mt->cpp == 2) {
       internalFormat = GL_RGB;
-      texFormat = MESA_FORMAT_RGB565;
+      texFormat = MESA_FORMAT_B5G6R5_UNORM;
    }
 
    _mesa_lock_texture(&intel->ctx, texObj);