On Sun, 12 Feb 2012 01:13:21 -0800, Kenneth Graunke <kenn...@whitecape.org> wrote: > On 02/11/2012 01:13 PM, Eric Anholt wrote: > > On Fri, 10 Feb 2012 22:24:08 -0800, Kenneth Graunke<kenn...@whitecape.org> > > wrote: > >> We don't want to use brw->sampler.count here, as it includes samplers > >> used only by the FS...which is most of them. > >> > >> This also lets us drop the CACHE_NEW_SAMPLER dirty bit on Gen6. > > > > My plan for samplers was that we can just look at what our program uses > > at compile time and save that in prog_data, so it would be > > CACHE_NEW_{VS,WM}_PROG instead. > > I like that idea.
OK, so my plan had a bit too much hand-waving in it. We put textures in the sampler and binding table at their texture unit offset. So as the sampler to unit mapping changes (from glUniform1i() on the sampler), the sampler count can change. I think I want to take a stab at making the sampler mapping occur outside of the compiled shader. We can't make the shaders entirely independent of sampler uniform numbers, due to the GL_CLAMP fixups, and I think texrects too. But if we did make separate samplers/binding tables for VS/FS and make them be based off of sampler numbers instead of unit numbers, we can generally avoid the recompiles, and definitely avoid the state changes you were looking at.
pgpShWHp6TTGo.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev