[Mesa-dev] [PATCH] i965: Don't set the sampler count in 3DSTATE_VS.

Eric Anholt eric at anholt.net
Mon Feb 13 17:25:27 PST 2012

On Sun, 12 Feb 2012 01:13:21 -0800, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On 02/11/2012 01:13 PM, Eric Anholt wrote:
> > On Fri, 10 Feb 2012 22:24:08 -0800, Kenneth Graunke<kenneth at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120213/dda412f3/attachment.pgp>

More information about the mesa-dev mailing list