Use ctx->Const.MaxTextureImageUnits and MaxTextureCoordUnits in more places.