swrast->BlendFunc = _swrast_validate_blend_func;
if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
- for (i = 0 ; i < ctx->Const.FragmentProgram.MaxTextureImageUnits ; i++)
+ for (i = 0 ; i < ARRAY_SIZE(swrast->TextureSample); i++)
swrast->TextureSample[i] = NULL;
}
if (!swrast)
return; /* pipe hack */
- for (u = 0; u < ctx->Const.FragmentProgram.MaxTextureImageUnits; u++) {
+ for (u = 0; u < ARRAY_SIZE(swrast->TextureSample); u++) {
struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
/* Note: If tObj is NULL, the sample function will be a simple
* function that just returns opaque black (0,0,0,1).
swrast->Driver.SpanRenderStart = _swrast_span_render_start;
swrast->Driver.SpanRenderFinish = _swrast_span_render_finish;
- for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
+ for (i = 0; i < ARRAY_SIZE(swrast->TextureSample); i++)
swrast->TextureSample[i] = NULL;
/* SpanArrays is global and shared by all SWspan instances. However, when
/** Internal hooks, kept up to date by the same mechanism as above.
*/
blend_func BlendFunc;
- texture_sample_func TextureSample[MAX_TEXTURE_IMAGE_UNITS];
+ texture_sample_func TextureSample[MAX_COMBINED_TEXTURE_IMAGE_UNITS];
/** Buffer for saving the sampled texture colors.
* Needed for GL_ARB_texture_env_crossbar implementation.