<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 22, 2017 at 10:02 AM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jun 22, 2017 at 09:59:44AM -0700, Nanley Chery wrote:<br>
> On Thu, Jun 22, 2017 at 09:55:50AM -0700, Nanley Chery wrote:<br>
> > On Wed, Jun 21, 2017 at 06:07:29PM -0700, Jason Ekstrand wrote:<br>
> > > On Wed, Jun 21, 2017 at 5:15 PM, Nanley Chery <<a href="mailto:nanleychery@gmail.com">nanleychery@gmail.com</a>> wrote:<br>
> > ><br>
> > > > v2 (Jason Ekstrand):<br>
> > > > - Update commit title<br>
> > > > - Check aux level and layer as well<br>
> > > ><br>
> > > > Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
> > > > Reviewed-by: Iago Toral Quiroga <<a href="mailto:itoral@igalia.com">itoral@igalia.com</a>> (v1)<br>
> > > > ---<br>
> > > > src/intel/blorp/blorp.c | 7 +++++++<br>
> > > > src/intel/blorp/blorp_clear.c | 4 ----<br>
> > > > 2 files changed, 7 insertions(+), 4 deletions(-)<br>
> > > ><br>
> > > > diff --git a/src/intel/blorp/blorp.c b/src/intel/blorp/blorp.c<br>
> > > > index 9c88658e8a..7e30e20a59 100644<br>
> > > > --- a/src/intel/blorp/blorp.c<br>
> > > > +++ b/src/intel/blorp/blorp.c<br>
> > > > @@ -66,6 +66,8 @@ brw_blorp_surface_info_init(<wbr>struct blorp_context *blorp,<br>
> > > > unsigned int level, unsigned int layer,<br>
> > > > enum isl_format format, bool is_render_target)<br>
> > > > {<br>
> > > > + assert(level < surf->surf->levels);<br>
> > > > +<br>
> > > > info->enabled = true;<br>
> > > ><br>
> > > > if (format == ISL_FORMAT_UNSUPPORTED)<br>
> > > > @@ -90,6 +92,9 @@ brw_blorp_surface_info_init(<wbr>struct blorp_context *blorp,<br>
> > > > if (info->aux_usage != ISL_AUX_USAGE_NONE) {<br>
> > > > info->aux_surf = *surf->aux_surf;<br>
> > > > info->aux_addr = surf->aux_addr;<br>
> > > > + assert(level < info->aux_surf.levels);<br>
> > > > + assert(layer < MAX2(info->aux_surf.logical_<wbr>level0_px.depth >><br>
> > > > level,<br>
> > > > + info->aux_surf.logical_level0_<wbr>px.array_len));<br>
> > > > }<br>
> > > ><br>
> > > > info->clear_color = surf->clear_color;<br>
> > > > @@ -106,6 +111,8 @@ brw_blorp_surface_info_init(<wbr>struct blorp_context<br>
> > > > *blorp,<br>
> > > > info->view.array_len = MAX2(info->surf.logical_<wbr>level0_px.depth,<br>
> > > > info->surf.logical_level0_px.<wbr>array_len);<br>
> > > ><br>
> > > > + assert(layer < info->view.array_len);<br>
> > > ><br>
> > ><br>
> > > Might be more straightforward to move this assert to the top and make it<br>
> > > look like the aux assert. I don't care too much though.<br>
> > ><br>
> > ><br>
> ><br>
> > I agree. Could I apply your rb if I instead put this under the first<br>
> > assert in the function?<br>
> ><br>
> > assert(layer < MAX2(info->surf.logical_<wbr>level0_px.depth >> level,<br>
> > info->surf.logical_level0_px.<wbr>array_len));<br>
> ><br>
><br>
> Whoops, info->surf is not yet defined there. It should be:<br>
> assert(layer < MAX2(surf->surf.logical_<wbr>level0_px.depth >> level,<br>
> surf->surf.logical_level0_px.<wbr>array_len));<br>
<br>
</div></div>... and I forgot that surf->surf is a pointer. Sorry,<br>
<br>
surf->surf->logical[...]<br><div class="HOEnZb"><div class="h5"></div></div></blockquote><div><br></div><div>No worries. Yes, you can put my RB on it with that assuming you get it to compile. :-)<br><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> > > > +<br>
> > > > if (!is_render_target &&<br>
> > > > (info->surf.dim == ISL_SURF_DIM_3D ||<br>
> > > > info->surf.msaa_layout == ISL_MSAA_LAYOUT_ARRAY)) {<br>
> > > > diff --git a/src/intel/blorp/blorp_clear.<wbr>c b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > > index efacadfebe..369e18726f 100644<br>
> > > > --- a/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > > +++ b/src/intel/blorp/blorp_clear.<wbr>c<br>
> > > > @@ -707,10 +707,6 @@ blorp_ccs_resolve(struct blorp_batch *batch,<br>
> > > > struct blorp_params params;<br>
> > > > blorp_params_init(¶ms);<br>
> > > ><br>
> > > > - /* Layered and mipmapped fast clear is only available from Gen8<br>
> > > > onwards. */<br>
> > > > - assert(ISL_DEV_GEN(batch-><wbr>blorp->isl_dev) >= 8 ||<br>
> > > > - (level == 0 && layer == 0));<br>
> > > > -<br>
> > > > brw_blorp_surface_info_init(<wbr>batch->blorp, ¶ms.dst, surf,<br>
> > > > level, layer, format, true);<br>
> > > ><br>
> > > > --<br>
> > > > 2.13.1<br>
> > > ><br>
> > > > ______________________________<wbr>_________________<br>
> > > > mesa-dev mailing list<br>
> > > > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > > > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
> > > ><br>
</div></div></blockquote></div><br></div></div>