[Mesa-dev] [PATCH 01/13] intel/blorp: Assert on subresource in surface_info_init

Jason Ekstrand jason at jlekstrand.net
Mon Jun 19 23:05:04 UTC 2017


General comment:  "Subresource" is not a term that we've historically used
outside of Vulkan.  Maybe better to just say "intel/blorp: Assert that
levels and layers are in range"

On Tue, Jun 13, 2017 at 11:41 AM, Nanley Chery <nanleychery at gmail.com>
wrote:

> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/intel/blorp/blorp.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c
> index 9c88658e8a..993b42fa85 100644
> --- a/src/intel/blorp/blorp.c
> +++ b/src/intel/blorp/blorp.c
> @@ -66,6 +66,8 @@ 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);
> +
>     info->enabled = true;
>
>     if (format == ISL_FORMAT_UNSUPPORTED)
> @@ -106,6 +108,8 @@ brw_blorp_surface_info_init(struct blorp_context
> *blorp,
>     info->view.array_len = MAX2(info->surf.logical_level0_px.depth,
>                                 info->surf.logical_level0_px.array_len);
>
> +   assert(layer < info->view.array_len);
> +
>     if (!is_render_target &&
>         (info->surf.dim == ISL_SURF_DIM_3D ||
>          info->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)) {
> --
> 2.13.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170619/6219b930/attachment.html>


More information about the mesa-dev mailing list