[Mesa-dev] [PATCH 30/36] isl: Add asserts for gen8+ X/YOffset rules

Jason Ekstrand jason at jlekstrand.net
Thu Jun 30 00:37:49 UTC 2016


---
 src/intel/isl/isl_surface_state.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 1d354f3..1b269a3 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -423,6 +423,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)->bs == 1)
+            assert(info->x_offset_sa % 16 == 0);
+         if (isl_format_get_layout(info->view->format)->bs == 2)
+            assert(info->x_offset_sa % 8 == 0);
+      }
+
 #if GEN_GEN >= 7
       s.SurfaceArray = false;
 #endif
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list