James McAvoy wallows in it in his new film, Filth. He embraces the sexual depravity, drug and alcohol abuse, bullying, vile language, racism, and rank sexism of being a Scottish cop on the loose.

“There’s nooo place like home,” he narrates in his natural burr. And for detective Bruce Robertson, truly there isn’t.

Bruce wants a promotion, wants to make inspector. He’s willing to lie, blackmail and set his rival cops in the department against each other to get it.

“I’ve always believed it’s the winning that’s important,” he cracks, giving his version of the Olympic creed, “ not the ‘taking part.’ ”

A Japanese student has been murdered, and Bruce and his department are on the case. Not that there’s any rush.

“A wog’s a wog, for all that, eh?” That generic catchall British Empire slur still carries weight with this lot.

Jamie Bell plays a fellow cop who’s a real threat to Bruce’s promotion, so he’s got a ready supply of blackmail material on the lad. Brian McCardie is a racist homophobe detective, Emun Elliott a “metrosexual” ripe for undercutting through sexual-preference jokes. Imogen Poots plays the possibly competent female detective, Gary Lewis the aged simpleton, and John Sessions the clueless would-be screenwriter chief who plans to hand the promotion to the detective who solves this crime.

Bruce may have the inside track, being a good cop. But he can’t leave the coke, pills, booze and inhalers — anything he comes across — alone. He can’t not sexually harass suspects. And he can’t bury deep the demons that make him hallucinate a dead boy’s image, even as he lies about his mental health to the departmental shrink (Jim Broadbent).

Through it all, as he narrates the foibles of his peers and runs amok through Edinburgh and Glasgow (and Hamburg, Germany, for a laugh), McAvoy revels in being bad — very bad. It’s “Easy, peasy Japanesey” for his Bruce to share every ugly thought and social theory that pops into his demented head. Bruce likes his porn, his autoerotic-asphyxiation games, his assorted hookers, paramours and depraved pursuits. And McAvoy lets us see him enjoy it all.

Because the moment this experience or that transgression ends, Bruce is lost — a mess, a man with secrets, too many of which are easily guessed, even if others are revealed only in due course. McAvoy makes us feel Bruce’s emptiness, even if we never once feel for him.

Writer-director Jon S. Baird, working from the Irvine Welsh novel, doesn’t water down the thick accents, the slang or the sexual deviancy here, turning McAvoy loose on this loose, louche louse and letting his star get so down and dirty that you wonder how he’ll ever shake off his role.

We welcome your comments on this story, but please be civil. Do not use profanity, hate speech, threats, personal abuse, images, internet links or any device to draw undue attention. Our policy requires those wishing to post here to use their real identity.