isl/state: Add an assertion for IVB multisample array textures
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 28 Jun 2016 21:38:54 +0000 (14:38 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Aug 2016 21:46:22 +0000 (14:46 -0700)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/isl/isl_surface_state.c

index fb23414b85fab1107760bdabed0630316b346a72..990b7633d988b58f59038d6725bd97f96cf61538 100644 (file)
@@ -239,6 +239,19 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
    switch (s.SurfaceType) {
    case SURFTYPE_1D:
    case SURFTYPE_2D:
+      /* From the Ivy Bridge PRM >> RENDER_SURFACE_STATE::MinimumArrayElement:
+       *
+       *    "If Number of Multisamples is not MULTISAMPLECOUNT_1, this field
+       *    must be set to zero if this surface is used with sampling engine
+       *    messages."
+       *
+       * This restriction appears to exist only on Ivy Bridge.
+       */
+      if (GEN_GEN == 7 && !GEN_IS_HASWELL && !ISL_DEV_IS_BAYTRAIL(dev) &&
+          (info->view->usage & ISL_SURF_USAGE_TEXTURE_BIT) &&
+          info->surf->samples > 1)
+         assert(info->view->base_array_layer == 0);
+
       s.MinimumArrayElement = info->view->base_array_layer;
 
       /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth: