<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 23, 2016 at 9:52 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"><span class="">On Fri, Sep 23, 2016 at 12:17:19AM -0700, Jason Ekstrand wrote:<br>
> Compressed 1-D textures are not well-defined thing in either GL or Vulkan.<br>
> However, auxiliary surfaces are treated as compressed textures in ISL and<br>
> we can do HiZ and CCS with 1-D so we need to be able to create them. In<br>
> order to prevent actually using them (the docs say no), we assert in the<br>
> state setup code.<br>
><br>
<br>
</span>Thanks for updating this commit message!<br>
<div><div class="h5"><br>
> Signed-off-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> ---<br>
> src/intel/isl/isl.c | 12 +++++++-----<br>
> src/intel/isl/isl_surface_<wbr>state.c | 9 +++++++++<br>
> 2 files changed, 16 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
> index a75fddf..710c990 100644<br>
> --- a/src/intel/isl/isl.c<br>
> +++ b/src/intel/isl/isl.c<br>
> @@ -518,7 +518,6 @@ isl_calc_phys_level0_extent_<wbr>sa(const struct isl_device *dev,<br>
> assert(info->height == 1);<br>
> assert(info->depth == 1);<br>
> assert(info->samples == 1);<br>
> - assert(!isl_format_is_<wbr>compressed(info->format));<br>
><br>
> switch (dim_layout) {<br>
> case ISL_DIM_LAYOUT_GEN4_3D:<br>
> @@ -527,8 +526,8 @@ isl_calc_phys_level0_extent_<wbr>sa(const struct isl_device *dev,<br>
> case ISL_DIM_LAYOUT_GEN9_1D:<br>
> case ISL_DIM_LAYOUT_GEN4_2D:<br>
> *phys_level0_sa = (struct isl_extent4d) {<br>
> - .w = info->width,<br>
> - .h = 1,<br>
> + .w = isl_align_npot(info->width, fmtl->bw),<br>
> + .h = fmtl->bh,<br>
> .d = 1,<br>
> .a = info->array_len,<br>
> };<br>
> @@ -757,7 +756,7 @@ isl_calc_phys_slice0_extent_<wbr>sa_gen9_1d(<br>
> {<br>
> MAYBE_UNUSED const struct isl_format_layout *fmtl = isl_format_get_layout(info-><wbr>format);<br>
><br>
> - assert(phys_level0_sa->height == 1);<br>
> + assert(phys_level0_sa->height == fmtl->bh);<br>
> assert(phys_level0_sa->depth == 1);<br>
> assert(info->samples == 1);<br>
> assert(image_align_sa->w >= fmtl->bw);<br>
> @@ -1567,9 +1566,12 @@ get_image_offset_sa_gen9_1d(<wbr>const struct isl_surf *surf,<br>
> uint32_t *x_offset_sa,<br>
> uint32_t *y_offset_sa)<br>
> {<br>
> + MAYBE_UNUSED const struct isl_format_layout *fmtl =<br>
> + isl_format_get_layout(surf-><wbr>format);<br>
> +<br>
> assert(level < surf->levels);<br>
> assert(layer < surf->phys_level0_sa.array_<wbr>len);<br>
> - assert(surf->phys_level0_sa.<wbr>height == 1);<br>
> + assert(surf->phys_level0_sa.<wbr>height == fmtl->bh);<br>
> assert(surf->phys_level0_sa.<wbr>depth == 1);<br>
> assert(surf->samples == 1);<br>
><br>
<br>
</div></div>As mentioned in my previous reply, I no longer think we should update<br>
get_image_offset_sa_gen9_1d() and<br>
isl_calc_phys_slice0_extent_<wbr>sa_gen9_1d() as auxiliary surfaces won't<br>
have this layout.<span class=""><br></span></blockquote><div><br></div><div>Right... I didn't match your original comment with why until I thought about it a bit more. I dropped those hunks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> diff --git a/src/intel/isl/isl_surface_<wbr>state.c b/src/intel/isl/isl_surface_<wbr>state.c<br>
> index 979e140..210308c 100644<br>
> --- a/src/intel/isl/isl_surface_<wbr>state.c<br>
> +++ b/src/intel/isl/isl_surface_<wbr>state.c<br>
> @@ -215,6 +215,15 @@ isl_genX(surf_fill_state_s)(<wbr>const struct isl_device *dev, void *state,<br>
> assert(isl_format_supports_<wbr>rendering(dev->info, info->view->format));<br>
> else if (info->view->usage & ISL_SURF_USAGE_TEXTURE_BIT)<br>
> assert(isl_format_supports_<wbr>sampling(dev->info, info->view->format));<br>
> +<br>
> + /* From the Sky Lake PRM Vol. 2d, RENDER_SURFACE_STATE::<wbr>SurfaceFormat<br>
> + *<br>
> + * This field cannot be a compressed (BC*, DXT*, FXT*, ETC*, EAC*)<br>
> + * format if the Surface Type is SURFTYPE_1D<br>
> + */<br>
> + if (info->surf->dim == ISL_SURF_DIM_1D)<br>
> + assert(!isl_format_is_<wbr>compressed(info->view->format)<wbr>);<br>
> +<br>
<br>
</span>Thanks for adding this assertion! Placing it in get_surftype()<br>
may be a better fit as it already has assertions against 1D images used<br>
as cube maps.<br>
<span class=""><br>
> s.SurfaceFormat = info->view->format;<br>
><br>
> #if GEN_IS_HASWELL<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</span>> ______________________________<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>
</blockquote></div><br></div></div>