[Mesa-dev] [PATCH] nv50, nvc0: Fix gallium nine regression regarding sampler bindings

Ilia Mirkin imirkin at alum.mit.edu
Sun Nov 25 23:19:09 UTC 2018


Yeah, the common case of a handful of textures bound, it saves a lot
of iterations (not to mention the current max of 16 on nv50). This
stuff comes up on drawoverhead, I'd imagine. Since it's trivial to
implement, I don't really understand why we're talking about this...
On Sun, Nov 25, 2018 at 6:15 PM Karol Herbst <kherbst at redhat.com> wrote:
>
> On Mon, Nov 26, 2018 at 12:08 AM Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> >
> > On Sun, Nov 25, 2018 at 5:43 PM Karol Herbst <kherbst at redhat.com> wrote:
> > >
> > > On Sun, Nov 25, 2018 at 5:48 PM Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> > > >
> > > > Would it make sense to instead keep track of a samplers_bound[] like
> > > > we do for textures? It's only ever used in a context of
> > > >
> > > > for (i = 0; i < num_samplers; i++)
> > > >   if (samplers[i])
> > > >      do stuff
> > > >
> > > > So having a mask would actually optimize that, and make this logic much simpler.
> > >
> > > was trying to come up with something more meaningful, but we usually
> > > loop over all samplers anyway, so we either loop until we had
> > > num_samplers or we check the mask up to PIPE_NUM_SAMPLERS bits... I
> > > doubt that we would win much at all. Anyway, in my local version of
> > > that patch I dropped those "num_samplers[s] = 0;" assignments as they
> > > weren't making much sense to begin with. We might be able to decrease
> > > num_samplers if we remove the last one, but I don't want to change
> > > much of the behavior here anyway. We could improve that code in future
> > > patches though.
> >
> > Then you should drop num_samplers entirely.
> >
> > But really, just make a mask, and iterate over the bits in the mask.
> > Should be trivial.
>
> is there any difference in having a mask around or just checking for
> the pointer being NULL inside samplers[s]? We always have to make
> PIPE_MAX_SAMPLERS iterations at least to iterate over all
> bits/samplers (except when stage_sampler_states_bind gets called). I
> would just drop num_samplers and don't add a bitmask, because I don't
> really see the benefit of having such around then.


More information about the mesa-dev mailing list