if (mt->etc_format != MESA_FORMAT_NONE)
mt_format = mt->etc_format;
- if (image->TexFormat != mt_format)
+ if (_mesa_get_srgb_format_linear(image->TexFormat) !=
+ _mesa_get_srgb_format_linear(mt_format))
return false;
intel_get_image_dims(image, &width, &height, &depth);
assert(src_layer < get_num_phys_layers(&src_mt->surf,
src_level - src_mt->first_level));
- assert(src_mt->format == dst_mt->format);
+ assert(_mesa_get_srgb_format_linear(src_mt->format) ==
+ _mesa_get_srgb_format_linear(dst_mt->format));
if (dst_mt->compressed) {
unsigned int i, j;
intel_texobj->needs_validate = false;
intel_texobj->validated_first_level = 0;
intel_texobj->validated_last_level = levels - 1;
- intel_texobj->_Format = intel_texobj->mt->format;
+ intel_texobj->_Format = first_image->TexFormat;
return true;
}
bool needs_validate;
/* Mesa format for the validated texture object. For non-views this
- * will always be the same as mt->format. For views, it may differ
- * since the mt is shared across views with differing formats.
+ * will always be the same as texObj->Image[0][0].TexFormat. For views, it
+ * may differ since the mt is shared across views with differing formats.
*/
mesa_format _Format;
intelObj->validated_first_level = validate_first_level;
intelObj->validated_last_level = validate_last_level;
- intelObj->_Format = intelObj->mt->format;
+ intelObj->_Format = firstImage->base.Base.TexFormat,
intelObj->needs_validate = false;
}