i965: Use miptree to decide format on multi-plane images for gen < 7
authorJordan Justen <jordan.l.justen@intel.com>
Sun, 12 Jun 2016 01:16:47 +0000 (18:16 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 26 Jun 2016 17:49:34 +0000 (10:49 -0700)
This wasn't handled correctly for multi-plane images on gen < 7 in
727a9b24933d384f5440ed4318fb720ed11d6dd1.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96674
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index d241ec94fd67b7412f224d929890b65ffbe42fc0..eed16acf31c8631b6bfdcbc6576eac28d6b1816c 100644 (file)
@@ -316,7 +316,8 @@ brw_update_texture_surface(struct gl_context *ctx,
    surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,
                          6 * 4, 32, surf_offset);
 
-   uint32_t tex_format = translate_tex_format(brw, intelObj->_Format,
+   mesa_format mesa_fmt = plane == 0 ? intelObj->_Format : mt->format;
+   uint32_t tex_format = translate_tex_format(brw, mesa_fmt,
                                               sampler->sRGBDecode);
 
    if (for_gather) {