[Mesa-dev] [PATCH 27/64] isl/state: Add assertions for buffer surface restrictions

Jason Ekstrand jason at jlekstrand.net
Sat Jun 11 16:02:42 UTC 2016


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

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 8f223d1..ca13175 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -416,6 +416,17 @@ isl_genX(buffer_fill_state_s)(void *state,
 {
    uint32_t num_elements = info->size / info->stride;
 
+   if (GEN_GEN >= 7) {
+      if (info->format == ISL_FORMAT_RAW) {
+         assert(num_elements <= (1ull << 31));
+         assert((num_elements & 3) == 0);
+      } else {
+         assert(num_elements <= (1ull << 27));
+      }
+   } else {
+      assert(num_elements <= (1ull << 27));
+   }
+
    struct GENX(RENDER_SURFACE_STATE) surface_state = {
       .SurfaceType = SURFTYPE_BUFFER,
       .SurfaceArray = false,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list