When comparing to the teximage's format, we have to look at the
format-the-mt-was-created-for not the format-actually-stored-in-the-mt.
Improves glbenchmark 2.1 offscreen test performance 159% +/- 17% (n=3).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54582
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
if (target_to_target(image->TexObject->Target) != mt->target)
return false;
- if (image->TexFormat != mt->format &&
- !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
- mt->format == MESA_FORMAT_X8_Z24 &&
- mt->stencil_mt)) {
+ gl_format mt_format = mt->format;
+ if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)
+ mt_format = MESA_FORMAT_S8_Z24;
+ if (mt->etc_format != MESA_FORMAT_NONE)
+ mt_format = mt->etc_format;
+
+ if (image->TexFormat != mt_format)
return false;
- }
intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);