[Mesa-dev] [PATCH 1/3] isl: Add a null surface fill function.

Jason Ekstrand jason at jlekstrand.net
Sat Aug 19 05:06:14 UTC 2017


On Fri, Aug 18, 2017 at 9:46 PM, Kenneth Graunke <kenneth at whitecape.org>
wrote:

> On Thursday, August 17, 2017 10:26:44 PM PDT Jason Ekstrand wrote:
> > On August 17, 2017 4:36:42 PM Kenneth Graunke <kenneth at whitecape.org>
> wrote:
> >
> > > ISL already offers functions to fill out most kinds of SURFACE_STATE,
> > > so why not handle null surfaces too?
> > >
> > > Null surfaces are simple, so we can just take the dimensions, rather
> > > than an entirte fill structure.
> > > ---
> > >  src/intel/isl/isl.c               |  7 +++++++
> > >  src/intel/isl/isl.h               |  4 ++++
> > >  src/intel/isl/isl_genX_priv.h     |  3 +++
> > >  src/intel/isl/isl_surface_state.c | 26 ++++++++++++++++++++++++++
> > >  4 files changed, 40 insertions(+)
> > >
> > >  Applies on top of Jason's patches:
> > >  https://lists.freedesktop.org/archives/mesa-dev/2017-August/
> 166628.html
> > >
> > > diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> > > index 3788f9c2ead..59f512fc050 100644
> > > --- a/src/intel/isl/isl.c
> > > +++ b/src/intel/isl/isl.c
> > > @@ -1811,6 +1811,13 @@ isl_buffer_fill_state_s(const struct isl_device
> > > *dev, void *state,
> > >     isl_genX_call(dev, buffer_fill_state_s, state, info);
> > >  }
> > >
> > > +void
> > > +isl_null_fill_state(const struct isl_device *dev, void *state,
> > > +                    struct isl_extent3d size)
> >
> > I might be inclined to make this an extent4d, assert that one off depth
> and
> > array_length is zero, and take the maximum of the two as the depth.
> Thoughts?
>
> I suppose if you wanted a null surface with a different depth and render
> target view extent, then an isl_extent4d could be useful.  But...neither
> driver actually wants to do that today.  So it seems simpler to keep them
> the same, and make the caller pass the width/height/depth they want the
> surface to have.  Seems like less magic.  That's my preference, anyway.
>

My thought was more that layered rendering is more of a 2d array thing so
you want width, height, and array_len and not depth.  ISL tries very hard
to distinguish between depth and array_len.  To be honest, it's one of the
more annoying parts of the API though it is useful for clerity at some
points.  I think 3D is probably fine in this case.

All three are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>


> > > +{
> > > +   isl_genX_call(dev, null_fill_state, state, size);
> >
> > This is so much nicer.  Thanks for complaining.
>
> Thanks for tidying it up :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170818/9e0d9807/attachment.html>


More information about the mesa-dev mailing list