anv/cmd_buffer: Fix arrayed depth/stencil attachments
[mesa.git] / src / intel / blorp / blorp_blit.c
index 280d6e1943635070a4429ad9a6c3d5d9bc6509f7..1cbd9403c98255ec30d2e157681f8a41607226d2 100644 (file)
@@ -28,6 +28,8 @@
 
 #define FILE_DEBUG_FLAG DEBUG_BLORP
 
+static const bool split_blorp_blit_debug = false;
+
 /**
  * Enum to specify the order of arguments in a sampler message
  */
@@ -1517,9 +1519,14 @@ can_shrink_surfaces(const struct blorp_params *params)
 }
 
 static unsigned
-get_max_surface_size()
+get_max_surface_size(const struct gen_device_info *devinfo,
+                     const struct blorp_params *params)
 {
-   return 16384;
+   const unsigned max = devinfo->gen >= 7 ? 16384 : 8192;
+   if (split_blorp_blit_debug && can_shrink_surfaces(params))
+      return max >> 4; /* A smaller restriction when debug is enabled */
+   else
+      return max;
 }
 
 struct blt_axis {
@@ -1940,7 +1947,7 @@ do_blorp_blit(struct blorp_batch *batch,
       y_scale = -y_scale;
 
    bool x_done, y_done;
-   bool shrink = false;
+   bool shrink = split_blorp_blit_debug && can_shrink_surfaces(orig_params);
    do {
       params = *orig_params;
       blit_coords = split_coords;