- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- if (softpipe->tex_cache[i] &&
- softpipe->tex_cache[i]->texture == texture)
- return PIPE_REFERENCED_FOR_READ;
- }
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
- if (softpipe->vertex_tex_cache[i] &&
- softpipe->vertex_tex_cache[i]->texture == texture)
- return PIPE_REFERENCED_FOR_READ;
- }
- for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
- if (softpipe->geometry_tex_cache[i] &&
- softpipe->geometry_tex_cache[i]->texture == texture)
- return PIPE_REFERENCED_FOR_READ;
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
+ for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) {
+ if (softpipe->tex_cache[sh][i] &&
+ softpipe->tex_cache[sh][i]->texture == texture)
+ return SP_REFERENCED_FOR_READ;
+ }