isl: Add asserts for gen8+ X/YOffset rules
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 27 Jun 2016 15:43:27 +0000 (08:43 -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 6febcbf2b72a6ec3ead3c994780b213292a13558..fb23414b85fab1107760bdabed0630316b346a72 100644 (file)
@@ -414,6 +414,16 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
       assert(info->surf->levels == 1);
       assert(info->surf->logical_level0_px.array_len == 1);
       assert(info->aux_usage == ISL_AUX_USAGE_NONE);
+
+      if (GEN_GEN >= 8) {
+         /* Broadwell added more rules. */
+         assert(info->surf->samples == 1);
+         if (isl_format_get_layout(info->view->format)->bpb == 8)
+            assert(info->x_offset_sa % 16 == 0);
+         if (isl_format_get_layout(info->view->format)->bpb == 16)
+            assert(info->x_offset_sa % 8 == 0);
+      }
+
 #if GEN_GEN >= 7
       s.SurfaceArray = false;
 #endif