Browse Source

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.
tags/mesa_20090313
Brian Paul 18 years ago
parent
commit
b45669283f
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/gallium/auxiliary/cso_cache/cso_context.c

+ 4
- 2
src/gallium/auxiliary/cso_cache/cso_context.c 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;


Loading…
Cancel
Save