cso: fix incorrect sampler view count in cso_restore_sampler_views()
authorBrian Paul <brianp@vmware.com>
Tue, 15 Oct 2013 23:09:22 +0000 (17:09 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 16 Oct 2013 14:13:47 +0000 (08:13 -0600)
commite96c55ff495528fc70fb5363d60bf4c645bc2082
treeb99d8b66d39931b001f74f2be67e4c2790a3ddef
parent0d1011638b079f8d6df942416f58b20043eea892
cso: fix incorrect sampler view count in cso_restore_sampler_views()

During the recent bind_sampler_states() interface change in gallium
we changed the CSO single_sampler_done() function so that if we were
decreasing the number of sampler states bound in the driver, we'd
null-out the "extra/old" sampler states to unbind them.  See commit
1e2fbf265.

However, we didn't make the corresponding fix for sampler views.
This caused an assertion to fail in the svga driver which checked
that the number of sampler views matched the number of sampler states.

This patch fixes cso_restore_sampler_views() so that it nulls-out
the extra/old sampler views if the number of new views is less than
the number of current/old views.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/cso_cache/cso_context.c