This gives us a better bound for some hot loops in the drivers than
MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
hardware, and only getting worse as more shader stages are added.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/** Bitwise-OR of all Texture.Unit[i]._GenFlags */
GLbitfield _GenFlags;
+
+ /** Upper bound on _ReallyEnabled texunits. */
+ GLint _MaxEnabledTexImageUnit;
};
ctx->Texture._GenFlags = 0x0;
ctx->Texture._TexMatEnabled = 0x0;
ctx->Texture._TexGenEnabled = 0x0;
+ ctx->Texture._MaxEnabledTexImageUnit = -1;
/*
* Update texture unit state.
/* if we get here, we know this texture unit is enabled */
ctx->Texture._EnabledUnits |= (1 << unit);
+ ctx->Texture._MaxEnabledTexImageUnit = unit;
if (enabledTargetsByStage[MESA_SHADER_FRAGMENT])
enabledFragUnits |= (1 << unit);