[Mesa-dev] [PATCH 0.5/3] anv/blorp: Don't create linear ASTC surfaces for buffers
Nanley Chery
nanleychery at gmail.com
Thu Nov 3 17:55:30 UTC 2016
On Wed, Nov 02, 2016 at 08:00:04PM -0700, Jason Ekstrand wrote:
> Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
>
Thanks!
> Wouldn't be a bad idea to do this for all compressed formats. It doesn't
> really matter though since blorp will nuke the format the moment it cones
> into blorp_copy anyway.
>
Yeah, since blorp already handles compressed formats in general, I just
went for the simplest approach.
> On Nov 2, 2016 4:56 PM, "Nanley Chery" <nanleychery at gmail.com> wrote:
>
> > Such a surface is not possible on our hardware. Without this change, ISL
> > surface creation would fail with the next patch.
> >
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >
> > This series requires the following extra patch, seemingly due to the
> > recent changes with blorp.
> >
> > src/intel/vulkan/anv_blorp.c | 16 ++++++++++++++++
> > 1 file changed, 16 insertions(+)
> >
> > diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> > index 87f242c..0feb5d5 100644
> > --- a/src/intel/vulkan/anv_blorp.c
> > +++ b/src/intel/vulkan/anv_blorp.c
> > @@ -126,6 +126,22 @@ get_blorp_surf_for_anv_buffer(struct anv_device
> > *device,
> > struct blorp_surf *blorp_surf,
> > struct isl_surf *isl_surf)
> > {
> > + const struct isl_format_layout *fmtl =
> > + isl_format_get_layout(format);
> > +
> > + /* ASTC is the only format which doesn't support linear layouts.
> > + * Create an equivalently sized surface with ISL to get around this.
> > + */
> > + if (fmtl->txc == ISL_TXC_ASTC) {
> > + /* Use an equivalently sized format */
> > + format = ISL_FORMAT_R32G32B32A32_UINT;
> > + assert(fmtl->bpb == isl_format_get_layout(format)->bpb);
> > +
> > + /* Shrink the dimensions for the new format */
> > + width = DIV_ROUND_UP(width, fmtl->bw);
> > + height = DIV_ROUND_UP(height, fmtl->bh);
> > + }
> > +
> > *blorp_surf = (struct blorp_surf) {
> > .surf = isl_surf,
> > .addr = {
> > --
> > 2.10.2
> >
> >
More information about the mesa-dev
mailing list