gallium: fix bug in cso_single_sampler_done() in computation of nr_samplers

Need to find highest used sampler so search from end toward beginning.
This commit is contained in:
Brian Paul 2008-03-19 16:41:54 -06:00
parent df5ba799fa
commit b45669283f

View file

@ -217,9 +217,11 @@ void cso_single_sampler_done( struct cso_context *ctx )
{
unsigned i;
for (i = 0; i < 8; i++)
if (ctx->samplers[i] == NULL)
/* find highest non-null sampler */
for (i = PIPE_MAX_SAMPLERS; i > 0; i--) {
if (ctx->samplers[i - 1] != NULL)
break;
}
ctx->nr_samplers = i;