Avoid looping over 32/48/96 (!!) tex image units every draw, most of
which we don't care about.
Improves performance on everyone's favorite not-a-benchmark by 2.9% on
Haswell.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
intel_renderbuffer_resolve_hiz(brw, depth_irb);
/* Resolve depth buffer and render cache of each enabled texture. */
- for (int i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) {
+ int maxEnabledUnit = ctx->Texture._MaxEnabledTexImageUnit;
+ for (int i = 0; i <= maxEnabledUnit; i++) {
if (!ctx->Texture.Unit[i]._ReallyEnabled)
continue;
tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
{
struct gl_context *ctx = &brw->ctx;
int i;
+ int maxEnabledUnit = ctx->Texture._MaxEnabledTexImageUnit;
- for (i = 0; i < ctx->Const.MaxCombinedTextureImageUnits; i++) {
+ for (i = 0; i <= maxEnabledUnit; i++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
if (texUnit->_ReallyEnabled) {