[Mesa-dev] [PATCH 5/9] i965: Replace open-coded gen6 queryobj offsets with simple helpers

Chris Wilson chris at chris-wilson.co.uk
Thu Jun 15 08:46:51 UTC 2017


Quoting Kenneth Graunke (2017-06-14 23:10:38)
> On Friday, June 9, 2017 6:01:36 AM PDT Chris Wilson wrote:
> > diff --git a/src/mesa/drivers/dri/i965/hsw_queryobj.c b/src/mesa/drivers/dri/i965/hsw_queryobj.c
> > index b81ab3b6f8..cb1a2df52d 100644
> > --- a/src/mesa/drivers/dri/i965/hsw_queryobj.c
> > +++ b/src/mesa/drivers/dri/i965/hsw_queryobj.c
> > @@ -191,7 +191,7 @@ load_overflow_data_to_cs_gprs(struct brw_context *brw,
> >                                struct brw_query_object *query,
> >                                int idx)
> >  {
> > -   int offset = idx * sizeof(uint64_t) * 4;
> > +   int offset = gen6_query_results_offset(query, 0) + idx * sizeof(uint64_t) * 4;
> 
> FWIW, I'm pretty sure 4 here is BRW_MAX_XFB_STREAMS.
> 
> I personally don't think that the code is more readable after patches
> 4-5, but I suppose that's a matter of taste.  I'd be inclined to leave the
> code with hardcoded offsets, but add a comment to the top of the file
> describing the layout (I thought we had one already, but it looks like we
> don't).

It's more about reviewability of the later patches. This was a
mechanical change that should have had no functional side-effect that
meant I could change the layout (of the common portion) in just one place.
That was the intention anyway.
-Chris


More information about the mesa-dev mailing list