i965/blorp/gen8: Use the correct max level and layer in emit_surface_states
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 4 Jun 2016 06:25:19 +0000 (23:25 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 22 Jun 2016 19:26:43 +0000 (12:26 -0700)
We were adding in the base which is wrong because the values given in the
miptree are relative to zero and not the base layer/level.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i965/gen8_blorp.c

index a9a400d906631fea492e25a9042870c316b1a38d..fcf5a5390737c0e4b301c2e97eef574d239d06a0 100644 (file)
@@ -627,13 +627,12 @@ gen8_blorp_emit_surface_states(struct brw_context *brw,
                            mt->target == GL_TEXTURE_CUBE_MAP;
       const unsigned depth = (is_cube ? 6 : 1) * mt->logical_depth0;
       const GLenum target = is_cube ? GL_TEXTURE_2D_ARRAY : mt->target;
-      const unsigned max_level = surface->level + mt->last_level + 1;
       const unsigned layer = mt->target != GL_TEXTURE_3D ?
                                 surface->layer / layer_divider : 0;
 
       brw->vtbl.emit_texture_surface_state(brw, mt, target,
-                                           layer, layer + depth,
-                                           surface->level, max_level,
+                                           layer, depth,
+                                           surface->level, mt->last_level + 1,
                                            surface->brw_surfaceformat,
                                            surface->swizzle,
                                            &wm_surf_offset_texture,