This is basically a direct translation of what we do for gen7.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83036
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
(mt->logical_depth0 - 1) << BRW_SURFACE_DEPTH_SHIFT |
(mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT);
+ const unsigned min_lod = tObj->MinLevel + tObj->BaseLevel - mt->first_level;
surf[4] = (brw_get_surface_num_multisamples(mt->num_samples) |
- SET_FIELD(tObj->BaseLevel - mt->first_level, BRW_SURFACE_MIN_LOD));
+ SET_FIELD(min_lod, BRW_SURFACE_MIN_LOD) |
+ SET_FIELD(tObj->MinLayer, BRW_SURFACE_MIN_ARRAY_ELEMENT));
surf[5] = mt->valign == 4 ? BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0;