[Mesa-dev] [PATCH v2 4/7] intel/isl: Allow multisampling with ISL_FORMAT_HiZ
Jason Ekstrand
jason at jlekstrand.net
Fri Sep 23 20:31:40 UTC 2016
On Sep 23, 2016 10:14 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:
>
> On Mon, Sep 12, 2016 at 05:58:21PM -0700, Jason Ekstrand wrote:
> > HiZ buffers can be multisampled and, on BDW+, simply using interleaved
>
> As stated in your comment in the second-to-last hunk, this is actually
> true for all platforms pre-SKL.
Yup. I'll fix that
> > multisampling with a compression block size of 8x4 samples yields the
> > correct HiZ surface size calculations. Unfortunately,
choose_msaa_layout
> > was rejecting multisampled HiZ buffers because of format checks. Now
that
> > we have a simple helper for determining if a format supports
multisampling,
> > that's an easy enough issue to fix.
> >
> > Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> > Reviewed-by: Chad Versace <chadversary at chromium.org>
> > ---
> > src/intel/isl/isl.c | 4 +++-
> > src/intel/isl/isl_format.c | 9 ++++++++-
> > 2 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > index 185984d..33d7079 100644
> > --- a/src/intel/isl/isl.c
> > +++ b/src/intel/isl/isl.c
> > @@ -572,7 +572,6 @@ isl_calc_phys_level0_extent_sa(const struct
isl_device *dev,
> > assert(info->depth == 1);
> > assert(info->levels == 1);
> > assert(isl_format_supports_multisampling(dev->info,
info->format));
> > - assert(fmtl->bw == 1 && fmtl->bh == 1);
> >
> > *phys_level0_sa = (struct isl_extent4d) {
> > .w = info->width,
> > @@ -584,6 +583,9 @@ isl_calc_phys_level0_extent_sa(const struct
isl_device *dev,
> > isl_msaa_interleaved_scale_px_to_sa(info->samples,
> > &phys_level0_sa->w,
> > &phys_level0_sa->h);
> > +
> > + phys_level0_sa->w = isl_align(phys_level0_sa->w, fmtl->bw);
> > + phys_level0_sa->h = isl_align(phys_level0_sa->h, fmtl->bh);
> > break;
> > }
> > break;
> > diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c
> > index f3429be..02df1ce 100644
> > --- a/src/intel/isl/isl_format.c
> > +++ b/src/intel/isl/isl_format.c
> > @@ -444,10 +444,17 @@ isl_format_supports_multisampling(const struct
brw_device_info *devinfo,
> > * - any compressed texture format (BC*)
> > * - any YCRCB* format
> > *
> > - * The restriction on the format's size is removed on Broadwell.
> > + * The restriction on the format's size is removed on Broadwell.
Also,
> > + * there is an exception for HiZ which we treat as a compressed
format and
> > + * is allowed to be multisampled on Broadwell and earlier.
> > */
> > if (devinfo->gen < 8 && isl_format_get_layout(format)->bpb > 64) {
> > return false;
> > + } else if (format == ISL_FORMAT_HIZ) {
>
> Because HiZ's bpb > 64, this if case should be moved up to handle the
> pre-BDW platforms.
Drp... You are correct, sir. I'll get that patched up.
> > + /* On SKL+, HiZ is always single-sampled even when the primary
surface
> > + * is multisampled. See also isl_surf_get_hiz_surf().
> > + */
> > + return devinfo->gen <= 8;
> > } else if (isl_format_is_compressed(format)) {
> > return false;
> > } else if (isl_format_is_yuv(format)) {
> > --
> > 2.5.0.400.gff86faf
> >
> > _______________________________________________
> > 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/20160923/17f02264/attachment.html>
More information about the mesa-dev
mailing list