isl/state: Don't set SurfacePitch for gen9 1-D textures
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Jun 2016 22:08:13 +0000 (15:08 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 22 Jun 2016 19:26:43 +0000 (12:26 -0700)
This field is ignored by the hardware in this case and, on very large 1-D
textures, it can end up being larger than the maximum allowed value.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/isl/isl_surface_state.c

index 9569c3ef44f72358089acfbe0ad5dccc8c26b5b6..15b2fa9cadcfb15dd1056e36f35aa0493d9cf2ae 100644 (file)
@@ -313,6 +313,9 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
        *    two rows interleaved."
        */
       s.SurfacePitch = info->surf->row_pitch * 2 - 1;
+   } else if (info->surf->dim_layout == ISL_DIM_LAYOUT_GEN9_1D) {
+      /* For gen9 1-D textures, surface pitch is ignored */
+      s.SurfacePitch = 0;
    } else {
       s.SurfacePitch = info->surf->row_pitch - 1;
    }