summaryrefslogtreecommitdiffstats
path: root/src/intel/blorp/blorp.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-05-11 10:58:18 -0700
committerNanley Chery <[email protected]>2017-06-26 11:09:12 -0700
commitb46a07175823ec476505cb8a0f8c353e5183d748 (patch)
treeeec93e34ce121da4a66e7c364e8d68c0d60a9c88 /src/intel/blorp/blorp.c
parent28550c787595f04453d2a39f46f570a891368fcf (diff)
intel/blorp: Assert levels and layers are in range
v2 (Jason Ekstrand): - Update commit title. - Check aux level and layer as well. v3 (Jason Ekstrand): - Move the non-aux layer check. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> (v1) Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp.c')
-rw-r--r--src/intel/blorp/blorp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
index 9c88658e8ac..a426a030d29 100644
--- a/src/intel/blorp/blorp.c
+++ b/src/intel/blorp/blorp.c
@@ -66,6 +66,10 @@ brw_blorp_surface_info_init(struct blorp_context *blorp,
unsigned int level, unsigned int layer,
enum isl_format format, bool is_render_target)
{
+ assert(level < surf->surf->levels);
+ assert(layer < MAX2(surf->surf->logical_level0_px.depth >> level,
+ surf->surf->logical_level0_px.array_len));
+
info->enabled = true;
if (format == ISL_FORMAT_UNSUPPORTED)
@@ -90,6 +94,9 @@ brw_blorp_surface_info_init(struct blorp_context *blorp,
if (info->aux_usage != ISL_AUX_USAGE_NONE) {
info->aux_surf = *surf->aux_surf;
info->aux_addr = surf->aux_addr;
+ assert(level < info->aux_surf.levels);
+ assert(layer < MAX2(info->aux_surf.logical_level0_px.depth >> level,
+ info->aux_surf.logical_level0_px.array_len));
}
info->clear_color = surf->clear_color;