mesa/varray: split update_array() into validate_array() and update_array()
[mesa.git] / src / mesa / main / genmipmap.c
index c952c4fda54bdce19eba453242fa654a74c9399c..6021c026f53915c95a0859cb176fc98cd98a1fee 100644 (file)
@@ -65,8 +65,7 @@ _mesa_is_valid_generate_texture_mipmap_target(struct gl_context *ctx,
          || !ctx->Extensions.EXT_texture_array;
       break;
    case GL_TEXTURE_CUBE_MAP_ARRAY:
-      error = _mesa_is_gles(ctx) ||
-              !ctx->Extensions.ARB_texture_cube_map_array;
+      error = !_mesa_has_texture_cube_map_array(ctx);
       break;
    default:
       error = true;
@@ -149,6 +148,11 @@ _mesa_generate_texture_mipmap(struct gl_context *ctx,
       return;
    }
 
+   if (srcImage->Width == 0 || srcImage->Height == 0) {
+      _mesa_unlock_texture(ctx, texObj);
+      return;
+   }
+
    if (target == GL_TEXTURE_CUBE_MAP) {
       GLuint face;
       for (face = 0; face < 6; face++) {