We don't care just about the internalFormat/cpp/compressed, but about
the specific format chosen. We have no support for format
translations as part of texture validation, and furthermore it has
restrictions in the GL specification. However, we should be making
consistent decisions for this check anyway.
intel_miptree_match_image(struct intel_mipmap_tree *mt,
struct gl_texture_image *image)
{
- GLboolean isCompressed = _mesa_is_format_compressed(image->TexFormat);
struct intel_texture_image *intelImage = intel_texture_image(image);
GLuint level = intelImage->level;
if (image->Border)
return GL_FALSE;
- if (image->InternalFormat != mt->internal_format ||
- isCompressed != mt->compressed)
- return GL_FALSE;
-
- if (!isCompressed &&
- !mt->compressed &&
- _mesa_get_format_bytes(image->TexFormat) != mt->cpp)
+ if (image->TexFormat != mt->format)
return GL_FALSE;
/* Test image dimensions against the base level image adjusted for
*/
if (intelObj->mt &&
(intelObj->mt->target != intelObj->base.Target ||
- intelObj->mt->internal_format != firstImage->base.InternalFormat ||
+ intelObj->mt->format != firstImage->base.TexFormat ||
intelObj->mt->first_level != tObj->BaseLevel ||
intelObj->mt->last_level < intelObj->_MaxLevel ||
intelObj->mt->width0 != firstImage->base.Width ||
intelObj->mt->height0 != firstImage->base.Height ||
- intelObj->mt->depth0 != firstImage->base.Depth ||
- intelObj->mt->cpp != cpp ||
- intelObj->mt->compressed != _mesa_is_format_compressed(firstImage->base.TexFormat))) {
+ intelObj->mt->depth0 != firstImage->base.Depth)) {
intel_miptree_release(intel, &intelObj->mt);
}