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

Kenneth Graunke kenneth at whitecape.org
Sat Aug 19 04:46:46 UTC 2017


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.

> > +{
> > +   isl_genX_call(dev, null_fill_state, state, size);
> 
> This is so much nicer.  Thanks for complaining.

Thanks for tidying it up :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170818/0deabd51/attachment-0001.sig>


More information about the mesa-dev mailing list