On Mon, Nov 26, 2018 at 12:08 AM Ilia Mirkin <[email protected]> wrote: > > On Sun, Nov 25, 2018 at 5:43 PM Karol Herbst <[email protected]> wrote: > > > > On Sun, Nov 25, 2018 at 5:48 PM Ilia Mirkin <[email protected]> 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. _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
