diff options
author | Jason Ekstrand <[email protected]> | 2016-09-12 11:46:22 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-09-12 16:48:56 -0700 |
commit | 2519237c2495adb9564062eed6b9cd225b886dc0 (patch) | |
tree | fd0d488e6cb18e1cd8ffa8dde018ff04cbf1caa2 | |
parent | 48f195d7c6483ed00a6d02526c6f35bb527fcaba (diff) |
intel/blorp: Handle the 512 layers restriction on Sandy Bridge
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/intel/blorp/blorp.c | 6 | ||||
-rw-r--r-- | src/intel/blorp/blorp_clear.c | 17 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c index 17c1ff4c134..8dfebbcb2ad 100644 --- a/src/intel/blorp/blorp.c +++ b/src/intel/blorp/blorp.c @@ -139,6 +139,12 @@ brw_blorp_surface_info_init(struct blorp_context *blorp, info->view.array_len -= info->view.base_array_layer; info->z_offset = 0; } + + /* Sandy Bridge has a limit of a maximum of 512 layers for layered + * rendering. + */ + if (is_render_target && blorp->isl_dev->info->gen == 6) + info->view.array_len = MIN2(info->view.array_len, 512); } diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index cba48234f96..2213ada2c6c 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -246,7 +246,6 @@ blorp_clear(struct blorp_batch *batch, { struct blorp_params params; blorp_params_init(¶ms); - params.num_layers = num_layers; params.x0 = x0; params.y0 = y0; @@ -278,10 +277,20 @@ blorp_clear(struct blorp_batch *batch, blorp_params_get_clear_kernel(batch->blorp, ¶ms, use_simd16_replicated_data); - brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level, - start_layer, format, true); + while (num_layers > 0) { + brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, surf, level, + start_layer, format, true); - batch->blorp->exec(batch, ¶ms); + /* We may be restricted on the number of layers we can bind at any one + * time. In particular, Sandy Bridge has a maximum number of layers of + * 512 but a maximum 3D texture size is much larger. + */ + params.num_layers = MIN2(params.dst.view.array_len, num_layers); + batch->blorp->exec(batch, ¶ms); + + start_layer += params.num_layers; + num_layers -= params.num_layers; + } } void |